This commit is contained in:
parent
7496a419cc
commit
bdc202b145
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue