7736-Añadir-parámetro-itemFk-a-buyUltimate #2805

Merged
carlosap merged 12 commits from 7736-Añadir-parámetro-itemFk-a-buyUltimate into test 2024-07-30 09:13:10 +00:00
3 changed files with 6 additions and 5 deletions
Showing only changes of commit b2a8326170 - Show all commits

View File

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

View File

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

View File

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