feat: #7109 inventoryType #2409
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue