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