7167-testToMaster_2414 #2244

Merged
alexm merged 643 commits from 7167-testToMaster_2414 into master 2024-04-04 05:32:41 +00:00
1 changed files with 5 additions and 5 deletions
Showing only changes of commit 09c9a3d7ef - Show all commits

View File

@ -26,7 +26,7 @@ BEGIN
DECLARE vParkingCode VARCHAR(10);
DECLARE vQuantity INT;
DECLARE vRemainder INT DEFAULT 0;
DECLARE vRestSaleFk INT;
DECLARE vRemainderSaleFk INT;
DECLARE vShelving VARCHAR(10);
DECLARE vTicketFk INT;
@ -36,7 +36,7 @@ BEGIN
s.itemFk,
s.concept
INTO vQuantity,
vRest,
vRemainder,
vTicketFk,
vItemFk,
vConcept
@ -47,14 +47,14 @@ BEGIN
UPDATE sale SET quantity = quantity - vRemainder WHERE id = vSaleFk;
INSERT INTO sale(ticketFk, itemFk, quantity, price, discount, concept)
SELECT ticketFk, itemFk, vRest, price, discount, concept
SELECT ticketFk, itemFk, vRemainder, price, discount, concept
FROM sale
WHERE id = vSaleFk;
SET vRestSaleFk = LAST_INSERT_ID();
SET vRemainderSaleFk = LAST_INSERT_ID();
INSERT INTO saleComponent(saleFk, componentFk, value)
SELECT vRestSaleFk, componentFk, value
SELECT vRemainderSaleFk, componentFk, value
FROM saleComponent
WHERE saleFk = vSaleFk;
END IF;