7167-testToMaster_2414 #2244

Merged
alexm merged 643 commits from 7167-testToMaster_2414 into master 2024-04-04 05:32:41 +00:00
1 changed files with 12 additions and 21 deletions
Showing only changes of commit a96743c3b9 - Show all commits

View File

@ -15,11 +15,8 @@ BEGIN
* @param vMaxAlertLevel Id nivel de alerta * @param vMaxAlertLevel Id nivel de alerta
* @param vWarehouseFk Id de almacén * @param vWarehouseFk Id de almacén
*/ */
DECLARE vMidnight DATETIME DEFAULT util.dayEnd(vDated); DECLARE vEndingDate DATETIME DEFAULT util.dayEnd(vDated) + INTERVAL vScopeDays DAY;
DECLARE vEndingDate DATETIME DEFAULT vMidnight + INTERVAL vScopeDays DAY;
CREATE OR REPLACE TEMPORARY TABLE tConfectionControlSource
ENGINE = MEMORY
SELECT t.shipped, SELECT t.shipped,
t.id ticketFk, t.id ticketFk,
s.id saleFk, s.id saleFk,
@ -73,27 +70,24 @@ BEGIN
AND tls.alertLevel < vMaxAlertLevel AND tls.alertLevel < vMaxAlertLevel
AND wh.hasConfectionTeam AND wh.hasConfectionTeam
AND t.shipped BETWEEN vDated AND vEndingDate AND t.shipped BETWEEN vDated AND vEndingDate
AND s.quantity > 0; AND s.quantity > 0
UNION ALL
-- Entradas
INSERT INTO tConfectionControlSource(
shipped,
ticketFk,
quantity,
concept,
category,
nickname,
warehouse,
description
)
SELECT tr.shipped, SELECT tr.shipped,
e.id, e.id,
NULL,
b.quantity, b.quantity,
i.name, i.name,
NULL,
i.category, i.category,
NULL,
whi.name, whi.name,
who.name, who.name,
ct.description NULL,
NULL,
NULL,
ct.description,
NULL,
NULL
FROM buy b FROM buy b
JOIN `entry` e ON e.id = b.entryFk JOIN `entry` e ON e.id = b.entryFk
JOIN travel tr ON tr.id = e.travelFk JOIN travel tr ON tr.id = e.travelFk
@ -105,8 +99,5 @@ BEGIN
WHERE who.hasConfectionTeam WHERE who.hasConfectionTeam
AND it.making AND it.making
AND tr.shipped BETWEEN vDated AND vEndingDate; AND tr.shipped BETWEEN vDated AND vEndingDate;
SELECT * FROM tConfectionControlSource;
DROP TEMPORARY TABLE tConfectionControlSource;
END$$ END$$
DELIMITER ; DELIMITER ;