Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7283-itemSectionsMigration
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-08-09 15:29:21 +02:00
commit 9ece46ee46
2 changed files with 6 additions and 7 deletions

View File

@ -25,12 +25,9 @@ BEGIN
IF(
aw.`type` = 'external',
(b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity,
IF(c.code = 'manaClaim',
sc.value * s.quantity,
0
)
)
)
FROM vn.sale s
JOIN vn.item i ON i.id = s.itemFk
JOIN vn.itemType it ON it.id = i.typeFk
@ -41,10 +38,8 @@ BEGIN
JOIN cache.last_buy lb ON lb.item_id = i.id
AND lb.warehouse_id = w.id
JOIN vn.buy b ON b.id = lb.buy_id
LEFT JOIN vn.saleComponent sc ON sc.saleFk = s.id
LEFT JOIN vn.component c ON c.id = sc.componentFk
WHERE t.shipped BETWEEN vDateFrom AND vDateTo
AND w.isManaged
GROUP BY it.id, i.id;
GROUP BY i.id;
END$$
DELIMITER ;

View File

@ -59,6 +59,10 @@ module.exports = Self => {
arg: 'showEmpty',
type: 'boolean',
description: 'Show empty orders'
}, {
arg: 'sourceApp',
type: 'string',
description: 'Application'
}
],
returns: {