From 38dbe6e966953fa5dac469b377ddca2a5edc04f4 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 9 Aug 2024 13:53:28 +0200 Subject: [PATCH] fix: #7126 waste_addSales --- db/routines/bs/procedures/waste_addSales.sql | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/db/routines/bs/procedures/waste_addSales.sql b/db/routines/bs/procedures/waste_addSales.sql index b855e8b0d..20eee5d49 100644 --- a/db/routines/bs/procedures/waste_addSales.sql +++ b/db/routines/bs/procedures/waste_addSales.sql @@ -25,10 +25,7 @@ BEGIN IF( aw.`type` = 'external', (b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity, - IF(c.code = 'manaClaim', - sc.value * s.quantity, - 0 - ) + 0 ) ) FROM vn.sale s @@ -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 ;