Merge pull request 'Hotfix-midnight-determinist' (!2548) from Hotfix-midnight-determinist into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2548 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
ba410360e9
|
@ -1,7 +1,7 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`midnight`()
|
||||
RETURNS datetime
|
||||
NOT DETERMINISTIC
|
||||
DETERMINISTIC
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ BEGIN
|
|||
DECLARE vIsTooLittle TINYINT(1);
|
||||
|
||||
SELECT (SUM(IFNULL(sv.litros, 0)) < vc.minTicketVolume
|
||||
OR IFNULL(t.totalWithoutVat, 0) < vc.minTicketValue) INTO vIsTooLittle
|
||||
AND IFNULL(t.totalWithoutVat, 0) < vc.minTicketValue) INTO vIsTooLittle
|
||||
FROM ticket t
|
||||
LEFT JOIN saleVolume sv ON sv.ticketFk = t.id
|
||||
JOIN volumeConfig vc
|
||||
|
|
|
@ -18,7 +18,7 @@ BEGIN
|
|||
FROM ticket t
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
WHERE t.shipped >= util.midnight()
|
||||
WHERE t.shipped >= util.VN_CURDATE()
|
||||
AND (vComponentFk IS NULL OR sc.componentFk = vComponentFk)
|
||||
GROUP BY s.id) sub;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ BEGIN
|
|||
ENGINE = MEMORY
|
||||
SELECT t.id ticketFk, FALSE hasProblem
|
||||
FROM ticket t
|
||||
WHERE t.shipped >= util.midnight()
|
||||
WHERE t.shipped >= util.VN_CURDATE()
|
||||
AND (vClientFk IS NULL OR t.clientFk = vClientFk);
|
||||
|
||||
UPDATE tmp.ticket t
|
||||
|
|
|
@ -13,7 +13,7 @@ BEGIN
|
|||
ENGINE = MEMORY
|
||||
SELECT t.id ticketFk, FALSE hasProblem
|
||||
FROM ticket t
|
||||
WHERE t.shipped >= util.midnight()
|
||||
WHERE t.shipped >= util.VN_CURDATE()
|
||||
AND (vSelf IS NULL OR t.id = vSelf);
|
||||
|
||||
UPDATE tmp.ticket t
|
||||
|
|
|
@ -14,7 +14,7 @@ BEGIN
|
|||
SELECT t.id ticketFk, IF(c.isTaxDataChecked, FALSE, TRUE) hasProblem
|
||||
FROM ticket t
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
WHERE t.shipped >= util.midnight()
|
||||
WHERE t.shipped >= util.VN_CURDATE()
|
||||
AND (c.id = vClientFk OR vClientFk IS NULL);
|
||||
|
||||
CALL ticket_setProblem('isTaxDataChecked');
|
||||
|
|
|
@ -16,7 +16,7 @@ BEGIN
|
|||
SELECT t.id ticketFk
|
||||
FROM vn.ticket t
|
||||
LEFT JOIN vn.sale s ON s.ticketFk = t.id
|
||||
WHERE t.shipped >= util.midnight()
|
||||
WHERE t.shipped >= util.VN_CURDATE()
|
||||
AND (s.itemFk = vItemFk OR vItemFk IS NULL)
|
||||
GROUP BY t.id
|
||||
)SELECT ticketFk, ticket_isTooLittle(ticketFk) hasProblem
|
||||
|
|
Loading…
Reference in New Issue