feat: #7109 inventoryType #2409

Merged
jgallego merged 1 commits from 7109-inventoryType into dev 2024-05-06 12:00:15 +00:00
1 changed files with 16 additions and 15 deletions
Showing only changes of commit f9348b41ea - Show all commits

View File

@ -94,15 +94,16 @@ BEGIN
SELECT id INTO vEntryFk SELECT id INTO vEntryFk
FROM entry FROM entry
WHERE supplierFk = vInventorySupplierFk WHERE supplierFk = vInventorySupplierFk
AND travelFk = vTravelFk; AND travelFk = vTravelFk
AND typeFk = 'inventory';
IF vEntryFk IS NULL THEN IF vEntryFk IS NULL THEN
INSERT INTO entry INSERT INTO entry
SET supplierFk = vInventorySupplierFk, SET supplierFk = vInventorySupplierFk,
isConfirmed = TRUE, isConfirmed = TRUE,
isOrdered = TRUE, isOrdered = TRUE,
travelFk = vTravelFk; travelFk = vTravelFk,
typeFk = 'inventory';
SELECT LAST_INSERT_ID() INTO vEntryFk; SELECT LAST_INSERT_ID() INTO vEntryFk;
ELSE ELSE
DELETE FROM buy WHERE entryFk = vEntryFk; DELETE FROM buy WHERE entryFk = vEntryFk;