feat: refs #7505 Minor changes
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
c2e9095ccd
commit
470c9bc872
|
@ -1,13 +1,13 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`visible_refresh`(OUT v_calc INT, v_refresh BOOL, v_warehouse INT)
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`visible_refresh`(OUT v_calc INT, v_refresh BOOL, v_warehouse INT)
|
||||||
proc: BEGIN
|
BEGIN
|
||||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||||
BEGIN
|
BEGIN
|
||||||
CALL cache_calc_unlock (v_calc);
|
CALL cache_calc_unlock (v_calc);
|
||||||
RESIGNAL;
|
RESIGNAL;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
CALL cache_calc_start (v_calc, v_refresh, 'visible', v_warehouse);
|
CALL cache_calc_start (v_calc, v_refresh, 'visible', v_warehouse);
|
||||||
|
|
||||||
IF !v_refresh THEN
|
IF !v_refresh THEN
|
||||||
LEAVE proc;
|
LEAVE proc;
|
||||||
|
@ -15,13 +15,13 @@ proc: BEGIN
|
||||||
|
|
||||||
-- Calculamos el stock hasta ayer
|
-- Calculamos el stock hasta ayer
|
||||||
|
|
||||||
CALL `cache`.stock_refresh(false);
|
CALL cache.stock_refresh(false);
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.itemVisible
|
CREATE OR REPLACE TEMPORARY TABLE tmp.itemVisible
|
||||||
(PRIMARY KEY (item_id))
|
(PRIMARY KEY (item_id))
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT item_id, amount stock, amount visible
|
SELECT item_id, amount stock, amount visible
|
||||||
FROM `cache`.stock
|
FROM cache.stock
|
||||||
WHERE warehouse_id = v_warehouse;
|
WHERE warehouse_id = v_warehouse;
|
||||||
|
|
||||||
-- Calculamos los movimientos confirmados de hoy
|
-- Calculamos los movimientos confirmados de hoy
|
||||||
|
@ -31,7 +31,7 @@ proc: BEGIN
|
||||||
INSERT INTO visible (calc_id, item_id,visible)
|
INSERT INTO visible (calc_id, item_id,visible)
|
||||||
SELECT v_calc, item_id, visible FROM tmp.itemVisible;
|
SELECT v_calc, item_id, visible FROM tmp.itemVisible;
|
||||||
|
|
||||||
CALL cache_calc_end (v_calc);
|
CALL cache_calc_end (v_calc);
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.itemVisible;
|
DROP TEMPORARY TABLE tmp.itemVisible;
|
||||||
END$$
|
END$$
|
||||||
|
|
Loading…
Reference in New Issue