feat: refs #7936 add company filter
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2024-11-27 10:24:13 +01:00
parent 4234e614fb
commit 5db1262e08
1 changed files with 10 additions and 4 deletions

View File

@ -91,6 +91,10 @@ module.exports = Self => {
{
arg: 'supplierActivityFk',
type: 'string',
},
{
arg: 'companyFk',
type: 'number',
}
],
returns: {
@ -161,8 +165,8 @@ module.exports = Self => {
: {'ii.id': {nin: correcteds.map(x => x.correctingFk)}};
case 'correctedFk':
return {'ii.id': {inq: correctings.map(x => x.correctingFk)}};
case 'supplierActivityFk':
return {'s.supplierActivityFk': value};
case 'companyFk':
return {'ii.companyFk': value};
}
});
@ -184,7 +188,8 @@ module.exports = Self => {
s.name supplierName,
s.account,
SUM(iid.amount) amount,
sub.code awbCode
sub.code awbCode,
c.code
FROM invoiceIn ii
JOIN supplier s ON s.id = ii.supplierFk
LEFT JOIN invoiceInDueDay iid ON iid.invoiceInFk = ii.id
@ -199,7 +204,8 @@ module.exports = Self => {
GROUP BY de.duaFk
) sub ON sub.duaFk = d.id
LEFT JOIN company co ON co.id = ii.companyFk
LEFT JOIN dms dm ON dm.id = ii.docFk`
LEFT JOIN dms dm ON dm.id = ii.docFk
JOIN company c ON c.id = ii.companyFk`,
);
const sqlWhere = conn.makeWhere(filter.where);