8524-devToTest #3415
|
@ -62,13 +62,16 @@ module.exports = Self => {
|
||||||
|
|
||||||
if (typeof options == 'object')
|
if (typeof options == 'object')
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
const where = buildFilter(ctx.args, (param, value) => {
|
const where = buildFilter(ctx.args, (param, value) => {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'bankFk':
|
case 'bankFk':
|
||||||
return {'bankFk': value};
|
return {[param]: value};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let stmts = [];
|
let stmts = [];
|
||||||
|
|
||||||
stmts.push(new ParameterizedSQL('CALL vn.supplier_statementWithEntries(?,?,?,?,?,?)', [
|
stmts.push(new ParameterizedSQL('CALL vn.supplier_statementWithEntries(?,?,?,?,?,?)', [
|
||||||
args.supplierId,
|
args.supplierId,
|
||||||
args.currencyFk ?? 1,
|
args.currencyFk ?? 1,
|
||||||
|
@ -77,14 +80,17 @@ module.exports = Self => {
|
||||||
args.isConciliated ?? false,
|
args.isConciliated ?? false,
|
||||||
false
|
false
|
||||||
]));
|
]));
|
||||||
|
|
||||||
const stmt = new ParameterizedSQL(`
|
const stmt = new ParameterizedSQL(`
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM tmp.supplierStatement`);
|
FROM tmp.supplierStatement`);
|
||||||
|
|
||||||
filter = mergeFilters(args.filter, {where});
|
filter = mergeFilters(args.filter, {where});
|
||||||
|
|
||||||
stmt.merge(conn.makeSuffix(filter));
|
stmt.merge(conn.makeSuffix(filter));
|
||||||
stmts.push(stmt);
|
stmts.push(stmt);
|
||||||
stmts.push(`DROP TEMPORARY TABLE tmp.supplierStatement`);
|
stmts.push(`DROP TEMPORARY TABLE tmp.supplierStatement`);
|
||||||
|
|
||||||
const sql = ParameterizedSQL.join(stmts, ';');
|
const sql = ParameterizedSQL.join(stmts, ';');
|
||||||
const results = await conn.executeStmt(sql);
|
const results = await conn.executeStmt(sql);
|
||||||
const resultsIndex = stmts.length - 2;
|
const resultsIndex = stmts.length - 2;
|
||||||
|
|
|
@ -8,7 +8,6 @@ module.exports = Self => {
|
||||||
require('../methods/supplier/updateFiscalData')(Self);
|
require('../methods/supplier/updateFiscalData')(Self);
|
||||||
require('../methods/supplier/consumption')(Self);
|
require('../methods/supplier/consumption')(Self);
|
||||||
require('../methods/supplier/freeAgencies')(Self);
|
require('../methods/supplier/freeAgencies')(Self);
|
||||||
require('../methods/supplier/createPayment')(Self);
|
|
||||||
require('../methods/supplier/receipts')(Self);
|
require('../methods/supplier/receipts')(Self);
|
||||||
require('../methods/supplier/campaignMetricsPdf')(Self);
|
require('../methods/supplier/campaignMetricsPdf')(Self);
|
||||||
require('../methods/supplier/campaignMetricsEmail')(Self);
|
require('../methods/supplier/campaignMetricsEmail')(Self);
|
||||||
|
|
Loading…
Reference in New Issue