diff --git a/db/routines/vn/procedures/itemShelvingSale_addBySale.sql b/db/routines/vn/procedures/itemShelvingSale_addBySale.sql index 454ea877f..df1a12806 100644 --- a/db/routines/vn/procedures/itemShelvingSale_addBySale.sql +++ b/db/routines/vn/procedures/itemShelvingSale_addBySale.sql @@ -75,6 +75,9 @@ proc: BEGIN WHERE saleFk = vSaleFk; IF vTotalReservedQuantity <> vSaleQuantity THEN + CALL util.debugAdd('itemShelvingSale_addBySale', + CONCAT(vSaleFk, ' - ', vSaleQuantity,' - ', vTotalReservedQuantity,'-', vOutStanding,'-', account.myUser_getId())); + UPDATE sale SET quantity = vTotalReservedQuantity WHERE id = vSaleFk; @@ -93,7 +96,8 @@ proc: BEGIN SET vOutStanding = vOutStanding - vReservedQuantity; IF vReservedQuantity > 0 THEN - + CALL util.debugAdd('itemShelvingSale_addBySale_reservedQuantity', + CONCAT(vSaleFk, ' - ', vReservedQuantity, ' - ', vOutStanding, account.myUser_getId())); INSERT INTO itemShelvingSale( itemShelvingFk, saleFk,