From 0f0c8250a1e905c75734879499dca71999092751 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 3 Dec 2024 08:44:00 +0100 Subject: [PATCH 1/2] fix: fix sql --- db/versions/11375-navyIvy/00-firstScript.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 db/versions/11375-navyIvy/00-firstScript.sql diff --git a/db/versions/11375-navyIvy/00-firstScript.sql b/db/versions/11375-navyIvy/00-firstScript.sql new file mode 100644 index 000000000..a90aaf519 --- /dev/null +++ b/db/versions/11375-navyIvy/00-firstScript.sql @@ -0,0 +1,2 @@ +ALTER TABLE vn.ticket DROP FOREIGN KEY tickets_zone_fk; +ALTER TABLE vn.ticket ADD CONSTRAINT tickets_zone_fk FOREIGN KEY (zoneFk) REFERENCES vn.`zone`(id) ON DELETE SET NULL ON UPDATE CASCADE; From 01d8f15d2f92920888baaa43c49b564820a656a9 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 3 Dec 2024 12:07:55 +0100 Subject: [PATCH 2/2] fix: refs #4948 expedition_selfConsumptionPackaging --- .../vn/procedures/expedition_selfConsumptionPackaging.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql b/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql index 327934a43..166ec476c 100644 --- a/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql +++ b/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql @@ -54,7 +54,9 @@ proc:BEGIN WHERE shipped BETWEEN vCreated AND util.dayEnd(vCreated) AND clientFk = vClientFk AND addressFk = vAddressFk - AND warehouseFk = vWarehouseFk; + AND warehouseFk = vWarehouseFk + AND nickname = 'CAJAS AUTOCONSUMO' + LIMIT 1; IF vTicketFk IS NULL AND vAction = 'add' THEN INSERT INTO ticket(clientFk, warehouseFk, shipped, nickname, addressFk)