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