From 980b7aa2cc65cd8460bc32eea692a8bc4abafc3b Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 18 Oct 2024 07:49:13 +0200 Subject: [PATCH] feat: refs #7709 cambios solicitados --- .../supplierPackaging_ReportSource.sql | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/db/routines/vn/procedures/supplierPackaging_ReportSource.sql b/db/routines/vn/procedures/supplierPackaging_ReportSource.sql index 19b03ad3e..aa50a2d81 100644 --- a/db/routines/vn/procedures/supplierPackaging_ReportSource.sql +++ b/db/routines/vn/procedures/supplierPackaging_ReportSource.sql @@ -5,14 +5,14 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`supplierPackaging_Rep ) BEGIN /** -* Create a report with packaging balance -* -* @param vFromDated Starting date -* @param vSupplierFk Supplier ID -*/ - DECLARE vUser INT; + * Create a report with packaging balance + * + * @param vFromDated Starting date + * @param vSupplierFk Supplier ID + */ + DECLARE vPerson INT; - SELECT id INTO vUser + SELECT id INTO vPerson FROM supplier WHERE nif = vNif; @@ -104,11 +104,11 @@ BEGIN GROUP BY p.itemFk ORDER BY itemFk , landed, entryFk )sub - WHERE (`out` OR `in`); + WHERE `out` OR `in`; - IF vUser IS NULL THEN + IF vPerson IS NULL THEN - SELECT id INTO vUser + SELECT id INTO vPerson FROM client WHERE fi = vNif; @@ -154,11 +154,11 @@ BEGIN GROUP BY itemFk ORDER BY itemFk , landed, entryFk ) sub - WHERE (`out` OR `in`); + WHERE `out` OR `in`; END IF; - SELECT vUser, + SELECT vPerson, itemFk, longName, name, @@ -170,7 +170,7 @@ BEGIN buyingValue, CAST(SUM(IF(`in`=0, -`out`, `in`)) OVER (PARTITION BY itemFk ORDER BY itemFk , landed, entryFk) AS DECIMAL(10,2)) balance FROM tSupplierPackaging - WHERE NOT (landed < CURDATE() - INTERVAL 1 YEAR) + WHERE NOT (landed < util.VN_CURDATE() - INTERVAL 1 YEAR) ORDER BY itemFk, landed, entryFk; DROP TEMPORARY TABLE tSupplierPackaging;