fix: refs #7931 Merge available fix into master #2936
|
@ -6,12 +6,20 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`available_update
|
|||
`vQuantity` INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Immediately deduct/add an amount from the available cache (if exists).
|
||||
*
|
||||
* @param vItem The item id
|
||||
* @param vWarehouse The warehouse id
|
||||
* @param vDated Available cache date
|
||||
* @param vQuantity The amount to be deducted from the cache
|
||||
*/
|
||||
DECLARE vCalc INT;
|
||||
|
||||
SELECT id INTO vCalc FROM cache_calc
|
||||
SELECT id INTO vCalc
|
||||
FROM cache_calc
|
||||
WHERE cacheName = 'available'
|
||||
AND params = CONCAT_WS('/', vWarehouse, vDated)
|
||||
AND last_refresh <= NOW();
|
||||
AND params = CONCAT_WS('/', vWarehouse, vDated);
|
||||
|
||||
IF vCalc IS NOT NULL THEN
|
||||
UPDATE available
|
||||
|
|
Loading…
Reference in New Issue