Merge pull request '6358-boxPicking_blueMammut' (!2230) from 6358-boxPicking_blueMammut into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2230 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
7aeb9e4f32
|
@ -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$$
|
|
@ -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';
|
Loading…
Reference in New Issue