#7134 SupplierBalance #3173

Merged
jsegarra merged 27 commits from 7134-supplierBalance into dev 2025-01-29 15:16:00 +00:00
2 changed files with 7 additions and 2 deletions
Showing only changes of commit f0e9cce228 - Show all commits

View File

@ -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 = [];
jsegarra marked this conversation as resolved Outdated

si no ponen currency no pasamos nada, no se ponen numero en el codigo

si no ponen currency no pasamos nada, no se ponen numero en el codigo
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;

View File

@ -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);