feat: refs #4948 Minor change
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-04-05 12:36:08 +02:00
parent 7496a419cc
commit bdc202b145
1 changed files with 5 additions and 8 deletions

View File

@ -15,16 +15,13 @@ BEGIN
DECLARE vTicketFk INT;
DECLARE vWarehouseFk INT;
SELECT clientSelfConsumptionFk, addressSelfConsumptionFk
INTO vClientFk, vAddressFk
FROM productionConfig;
SELECT id INTO vWarehouseFk
FROM warehouse
WHERE code = 'alg';
SELECT pc.clientSelfConsumptionFk, pc.addressSelfConsumptionFk, w.id
INTO vClientFk, vAddressFk, vWarehouseFk
FROM productionConfig pc
JOIN warehouse w ON w.code = 'alg';
INSERT INTO ticket(clientFk, warehouseFk, shipped, nickname, addressFk)
SELECT vClientFk, vWarehouseFk, vDateFrom, 'AUTOCONSUMO CAJAS', vAddressFk;
SELECT vClientFk, vWarehouseFk, vDateFrom, 'CAJAS AUTOCONSUMO', vAddressFk;
SET vTicketFk = LAST_INSERT_ID();