feat: refactor buyUltimate refs #7736
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Andrés 2024-07-19 12:44:45 +02:00
parent 4ee0bd687f
commit b2a8326170
3 changed files with 6 additions and 5 deletions

View File

@ -6,7 +6,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`buyUltimateFromInte
)
BEGIN
/**
* DEPRECATED usar buy_getUltimateFromInterval
* @deprecated Usar buy_getUltimateFromInterval
* Calcula las últimas compras realizadas
* desde un rango de fechas.
*

View File

@ -13,7 +13,7 @@ BEGIN
* @param vDated Compras hasta fecha
* @return tmp.buyUltimate
*/
CALL cache.last_buy_refresh (FALSE);
CALL cache.last_buy_refresh(FALSE);
DROP TEMPORARY TABLE IF EXISTS tmp.buyUltimate;
CREATE TEMPORARY TABLE tmp.buyUltimate

View File

@ -25,8 +25,8 @@ BEGIN
END IF;
-- Item
DROP TEMPORARY TABLE IF EXISTS tmp.buyUltimateFromInterval;
CREATE TEMPORARY TABLE tmp.buyUltimateFromInterval
CREATE OR REPLACE TEMPORARY TABLE tmp.buyUltimateFromInterval
(PRIMARY KEY (itemFk, warehouseFk),
INDEX(buyFk), INDEX(landed), INDEX(warehouseFk), INDEX(itemFk))
ENGINE = MEMORY
@ -97,7 +97,8 @@ BEGIN
LIMIT 10000000000000000000) sub
GROUP BY itemFk, warehouseFk;
-- ItemOriginal
-- ItemOriginal
INSERT IGNORE INTO tmp.buyUltimateFromInterval(itemFk, warehouseFk, buyFk, landed, isIgnored)
SELECT itemFk,
warehouseFk,