primer prototipo #2205

Merged
pako merged 8 commits from 6358-boxPicking_YellowZebra into dev 2024-03-28 07:20:37 +00:00
1 changed files with 18 additions and 21 deletions
Showing only changes of commit 861d9b3135 - Show all commits

View File

@ -1,8 +1,6 @@
DROP PROCEDURE IF EXISTS vn.boxPicking_print;
DELIMITER $$
pako marked this conversation as resolved
Review

si es fa un drop es perden el privilegis, per això els procs a dia de hui tots tenen create or replace

si es fa un drop es perden el privilegis, per això els procs a dia de hui tots tenen create or replace
$$
CREATE PROCEDURE vn.boxPicking_print(
CREATE OR REPLACE PROCEDURE vn.sale_boxPickingPrint(
IN vPrinterFk INT,
IN vSaleFk INT,
pako marked this conversation as resolved
Review

el nom del proc ha de fer referencia a la taula principal amb la que treballa

jo mirant-ho veig que s'agafa una sale i es meneja a un altre ticket.

CREATE OR REPLACE PROCEDURE vn.sale_splitAndPrint

Encara que es molt probable que si en el futur alguna etiqueta no s'imprimeix necesitem separa la part d'imprimir, per a que ho valores.

el nom del proc ha de fer referencia a la taula principal amb la que treballa jo mirant-ho veig que s'agafa una sale i es meneja a un altre ticket. CREATE OR REPLACE PROCEDURE vn.sale_splitAndPrint Encara que es molt probable que si en el futur alguna etiqueta no s'imprimeix necesitem separa la part d'imprimir, per a que ho valores.
IN vPacking INT,
@ -12,10 +10,9 @@ CREATE PROCEDURE vn.boxPicking_print(
IN vPackingSiteFk INT)
BEGIN
/** Splits a line of sale to a different ticket and prints the transport sticker
*
*/
DECLARE vAgencyModeFk INT;
DECLARE vConcept VARCHAR(20);
DECLARE vConcept VARCHAR(30);
DECLARE vExpeditionFk INT;
DECLARE vItemFk INT;
DECLARE vItemShelvingFk INT;
@ -64,7 +61,7 @@ BEGIN
w1: WHILE vQuantity >= vPacking DO
SET vItemShelvingFk = 0;
SET vItemShelvingFk = NULL;
SELECT sub.id
INTO vItemShelvingFk
pako marked this conversation as resolved
Review

vItemShelvingFk = NULL

vItemShelvingFk = NULL
@ -103,7 +100,7 @@ w1: WHILE vQuantity >= vPacking DO
LEAVE w1;
END IF;
SET vNewTicketFk = 0;
SET vNewTicketFk = NULL;
SELECT MAX(t.id) INTO vNewTicketFk
FROM vn.ticket t
@ -117,7 +114,7 @@ w1: WHILE vQuantity >= vPacking DO
AND t.warehouseFk = tt.warehouseFk
WHERE tls.name = 'Encajado' ;
IF vNewTicketFk = 0 THEN
IF ISNULL(vNewTicketFk) THEN
INSERT INTO vn.ticket( clientFk,
shipped,
addressFk,
@ -163,7 +160,7 @@ w1: WHILE vQuantity >= vPacking DO
UPDATE itemShelving SET visible = visible - vPacking WHERE id = vItemShelvingFk;
SET vNewSaleFk = 0;
SET vNewSaleFk = NULL;
SELECT MAX(id) INTO vNewSaleFk
FROM sale
pako marked this conversation as resolved
Review

millor gastar null per a dir que no hi ha un valor real

millor gastar null per a dir que no hi ha un valor real
@ -175,7 +172,7 @@ w1: WHILE vQuantity >= vPacking DO
SET quantity = quantity + vPacking
WHERE id = vNewSaleFk;
SET vItemShelvingSaleFk_old = 0;
SET vItemShelvingSaleFk_old = NULL;
SELECT MAX(id) INTO vItemShelvingSaleFk_old
FROM vn.itemShelvingSale
@ -245,8 +242,8 @@ w1: WHILE vQuantity >= vPacking DO
h.code,
vPackingSiteFk,
ps.monitorId,
started = IFNULL(vLastExpeditionTimeStamp, Now()),
ended = Now()
IFNULL(vLastExpeditionTimeStamp, Now()),
pako marked this conversation as resolved Outdated

NOW

NOW
Now()
FROM packingSite ps
JOIN host h ON h.id = ps.hostFk
JOIN item i ON i.name = 'Shipping cost'
@ -266,15 +263,15 @@ w1: WHILE vQuantity >= vPacking DO
JOIN parking p ON p.id = sh.parkingFk
WHERE ish.id = vItemShelvingFk;
UPDATE dipole.expedition_PrintOut SET
isPrinted = FALSE,
itemFk = vItemFk,
quantity = vPacking,
longName = vConcept,
shelvingFk = vShelving,
parkingCode = vParkingCode,
phone = RIGHT(phone,vMaxPhoneLength),
street = RIGHT(street, vMAxStreetLength)
UPDATE dipole.expedition_PrintOut
SET isPrinted = FALSE,
itemFk = vItemFk,
quantity = vPacking,
pako marked this conversation as resolved Outdated

SET en este cas votaria de linea

SET en este cas votaria de linea
longName = vConcept,
shelvingFk = vShelving,
parkingCode = vParkingCode,
phone = RIGHT(phone,vMaxPhoneLength),
street = RIGHT(street, vMAxStreetLength)
WHERE expeditionFk = vExpeditionFk;
DELETE FROM vn.sale