6358-boxPicking_blueMammut #2230

Merged
pako merged 10 commits from 6358-boxPicking_blueMammut into dev 2024-04-02 05:13:53 +00:00
2 changed files with 12 additions and 7 deletions

View File

@ -1,12 +1,12 @@
DELIMITER $$ DELIMITER $$
$$ $$
CREATE OR REPLACE PROCEDURE vn.sale_boxPickingPrint( CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE vn.sale_boxPickingPrint(
IN vPrinterFk INT, IN vPrinterFk INT,
IN vSaleFk INT, IN vSaleFk INT,
IN vPacking INT, IN vPacking INT,
IN vSectorFk INT, IN vSectorFk INT,
IN vUserFk INT, IN vUserFk INT,
IN vPackagingFk INT, IN vPackagingFk VARCHAR(10),
IN vPackingSiteFk INT) IN vPackingSiteFk INT)
BEGIN BEGIN
/** Splits a line of sale to a different ticket and prints the transport sticker /** Splits a line of sale to a different ticket and prints the transport sticker
@ -61,6 +61,8 @@ BEGIN
w1: WHILE vQuantity >= vPacking DO w1: WHILE vQuantity >= vPacking DO
SET vQuantity = vQuantity - vPacking;
SET vItemShelvingFk = NULL; SET vItemShelvingFk = NULL;
SELECT sub.id SELECT sub.id
@ -191,7 +193,7 @@ w1: WHILE vQuantity >= vPacking DO
ELSE ELSE
UPDATE itemShelvingSale UPDATE itemShelvingSale
SET saleFk = vNewSaleFk SET saleFk = vNewSaleFk
WHERE id = vItemShelvingSaleFk; WHERE id = vItemShelvingSaleFk;
END IF; END IF;
ELSE ELSE
INSERT INTO sale(ticketFk, itemFk, concept, quantity, discount, price) INSERT INTO sale(ticketFk, itemFk, concept, quantity, discount, price)
@ -209,6 +211,7 @@ w1: WHILE vQuantity >= vPacking DO
UPDATE itemShelvingSale UPDATE itemShelvingSale
SET saleFk = vNewSaleFk SET saleFk = vNewSaleFk
WHERE id = vItemShelvingSaleFk; WHERE id = vItemShelvingSaleFk;
END IF; END IF;
INSERT IGNORE INTO saleTracking(saleFk, isChecked, workerFk, stateFk) INSERT IGNORE INTO saleTracking(saleFk, isChecked, workerFk, stateFk)
@ -235,7 +238,7 @@ w1: WHILE vQuantity >= vPacking DO
) )
SELECT vAgencyModeFk, SELECT vAgencyModeFk,
vNewTicketFk, vNewTicketFk,
i.id, pc.defaultFreightItemFk,
vUserFk, vUserFk,
vPackagingFk, vPackagingFk,
ps.code, ps.code,
@ -246,9 +249,8 @@ w1: WHILE vQuantity >= vPacking DO
NOW() NOW()
FROM packingSite ps FROM packingSite ps
JOIN host h ON h.id = ps.hostFk JOIN host h ON h.id = ps.hostFk
JOIN item i ON i.name = 'Shipping cost' JOIN productionConfig pc
WHERE ps.id = vPackingSiteFk WHERE ps.id = vPackingSiteFk;
LIMIT 1;
SET vExpeditionFk = LAST_INSERT_ID(); SET vExpeditionFk = LAST_INSERT_ID();
@ -277,6 +279,7 @@ w1: WHILE vQuantity >= vPacking DO
DELETE FROM sale DELETE FROM sale
WHERE quantity = 0 WHERE quantity = 0
AND id = vSaleFk; AND id = vSaleFk;
END WHILE; END WHILE;
END$$ END$$

View File

@ -0,0 +1,2 @@
-- Place your SQL code here
ALTER TABLE vn.productionConfig ADD defaultFreightItemFk INT UNSIGNED DEFAULT 71 NOT NULL COMMENT 'Default value for expedition table';