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
FROM entry
WHERE supplierFk = vInventorySupplierFk
AND travelFk = vTravelFk;
AND travelFk = vTravelFk
AND typeFk = 'inventory';
IF vEntryFk IS NULL THEN
INSERT INTO entry
SET supplierFk = vInventorySupplierFk,
isConfirmed = TRUE,
isOrdered = TRUE,
travelFk = vTravelFk;
travelFk = vTravelFk,
typeFk = 'inventory';
SELECT LAST_INSERT_ID() INTO vEntryFk;
ELSE
DELETE FROM buy WHERE entryFk = vEntryFk;