diff --git a/db/routines/vn/procedures/expeditionPallet_build.sql b/db/routines/vn/procedures/expeditionPallet_build.sql index aae10d5a5..b2735c6bc 100644 --- a/db/routines/vn/procedures/expeditionPallet_build.sql +++ b/db/routines/vn/procedures/expeditionPallet_build.sql @@ -20,7 +20,7 @@ BEGIN DECLARE vExpeditionFk INT; DECLARE vTruckFk INT; DECLARE vPrinterFk INT; - DECLARE vExpeditionScanTypeFk INT; + DECLARE vExpeditionStateTypeFk INT; CREATE OR REPLACE TEMPORARY TABLE tExpedition ( expeditionFk INT, @@ -80,10 +80,10 @@ BEGIN FROM tExpedition ON DUPLICATE KEY UPDATE palletFk = vPalletFk, workerFk = vWorkerFk; - SELECT id INTO vExpeditionScanTypeFk FROM expeditionScanType WHERE code = 'PALLETIZED'; + SELECT id INTO vExpeditionStateTypeFk FROM expeditionStateType WHERE code = 'PALLETIZED'; INSERT INTO expeditionState(expeditionFk, typeFk) - SELECT expeditionFk, vExpeditionScanTypeFk FROM tExpedition; + SELECT expeditionFk, vExpeditionStateTypeFk FROM tExpedition; SELECT printerFk INTO vPrinterFk FROM arcRead WHERE id = vArcId;