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
|
`vQuantity` INT
|
||||||
)
|
)
|
||||||
BEGIN
|
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;
|
DECLARE vCalc INT;
|
||||||
|
|
||||||
SELECT id INTO vCalc FROM cache_calc
|
SELECT id INTO vCalc
|
||||||
|
FROM cache_calc
|
||||||
WHERE cacheName = 'available'
|
WHERE cacheName = 'available'
|
||||||
AND params = CONCAT_WS('/', vWarehouse, vDated)
|
AND params = CONCAT_WS('/', vWarehouse, vDated);
|
||||||
AND last_refresh <= NOW();
|
|
||||||
|
|
||||||
IF vCalc IS NOT NULL THEN
|
IF vCalc IS NOT NULL THEN
|
||||||
UPDATE available
|
UPDATE available
|
||||||
|
|
Loading…
Reference in New Issue