#6900 rectificative filter #2845

Merged
jorgep merged 9 commits from 6900-fineTunningInvoiceIn into dev 2024-08-09 10:32:14 +00:00
1 changed files with 2 additions and 0 deletions

View File

@ -119,6 +119,7 @@ module.exports = Self => {
} }
let correctings; let correctings;
let correcteds; let correcteds;
if (args.correctedFk) { if (args.correctedFk) {
correctings = await models.InvoiceInCorrection.find({ correctings = await models.InvoiceInCorrection.find({
@ -154,6 +155,7 @@ module.exports = Self => {
case 'awbCode': case 'awbCode':
return {'sub.code': value}; return {'sub.code': value};
case 'correctingFk': case 'correctingFk':
if (!correcteds.length && !args.correctingFk) return;
Review

Si no pongo esto forma un where vacío.

Si no pongo esto forma un where vacío.
return args.correctingFk return args.correctingFk
? {'ii.id': {inq: correcteds.map(x => x.correctingFk)}} ? {'ii.id': {inq: correcteds.map(x => x.correctingFk)}}
: {'ii.id': {nin: correcteds.map(x => x.correctingFk)}}; : {'ii.id': {nin: correcteds.map(x => x.correctingFk)}};