Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
37fa92aca8
|
@ -1,7 +1,7 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`midnight`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`midnight`()
|
||||||
RETURNS datetime
|
RETURNS datetime
|
||||||
NOT DETERMINISTIC
|
DETERMINISTIC
|
||||||
READS SQL DATA
|
READS SQL DATA
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ BEGIN
|
||||||
DECLARE vIsTooLittle TINYINT(1);
|
DECLARE vIsTooLittle TINYINT(1);
|
||||||
|
|
||||||
SELECT (SUM(IFNULL(sv.litros, 0)) < vc.minTicketVolume
|
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
|
FROM ticket t
|
||||||
LEFT JOIN saleVolume sv ON sv.ticketFk = t.id
|
LEFT JOIN saleVolume sv ON sv.ticketFk = t.id
|
||||||
JOIN volumeConfig vc
|
JOIN volumeConfig vc
|
||||||
|
|
|
@ -49,7 +49,10 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
IF vLockName IS NOT NULL THEN
|
IF vLockName IS NOT NULL THEN
|
||||||
DO RELEASE_LOCK(vLockName);
|
DO RELEASE_LOCK(vLockName);
|
||||||
CALL util.debugAdd('releaseLock', vLockName); -- Tmp
|
CALL util.debugAdd(JSON_OBJECT(
|
||||||
|
'type', 'releaseLock',
|
||||||
|
'userFk', vUserFk
|
||||||
|
), vLockName); -- Tmp
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
RESIGNAL;
|
RESIGNAL;
|
||||||
|
|
|
@ -18,7 +18,7 @@ BEGIN
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
JOIN sale s ON s.ticketFk = t.id
|
JOIN sale s ON s.ticketFk = t.id
|
||||||
LEFT JOIN saleComponent sc ON sc.saleFk = s.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)
|
AND (vComponentFk IS NULL OR sc.componentFk = vComponentFk)
|
||||||
GROUP BY s.id) sub;
|
GROUP BY s.id) sub;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ BEGIN
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT t.id ticketFk, FALSE hasProblem
|
SELECT t.id ticketFk, FALSE hasProblem
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
WHERE t.shipped >= util.midnight()
|
WHERE t.shipped >= util.VN_CURDATE()
|
||||||
AND (vClientFk IS NULL OR t.clientFk = vClientFk);
|
AND (vClientFk IS NULL OR t.clientFk = vClientFk);
|
||||||
|
|
||||||
UPDATE tmp.ticket t
|
UPDATE tmp.ticket t
|
||||||
|
|
|
@ -13,7 +13,7 @@ BEGIN
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT t.id ticketFk, FALSE hasProblem
|
SELECT t.id ticketFk, FALSE hasProblem
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
WHERE t.shipped >= util.midnight()
|
WHERE t.shipped >= util.VN_CURDATE()
|
||||||
AND (vSelf IS NULL OR t.id = vSelf);
|
AND (vSelf IS NULL OR t.id = vSelf);
|
||||||
|
|
||||||
UPDATE tmp.ticket t
|
UPDATE tmp.ticket t
|
||||||
|
|
|
@ -14,7 +14,7 @@ BEGIN
|
||||||
SELECT t.id ticketFk, IF(c.isTaxDataChecked, FALSE, TRUE) hasProblem
|
SELECT t.id ticketFk, IF(c.isTaxDataChecked, FALSE, TRUE) hasProblem
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
JOIN client c ON c.id = t.clientFk
|
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);
|
AND (c.id = vClientFk OR vClientFk IS NULL);
|
||||||
|
|
||||||
CALL ticket_setProblem('isTaxDataChecked');
|
CALL ticket_setProblem('isTaxDataChecked');
|
||||||
|
|
|
@ -16,7 +16,7 @@ BEGIN
|
||||||
SELECT t.id ticketFk
|
SELECT t.id ticketFk
|
||||||
FROM vn.ticket t
|
FROM vn.ticket t
|
||||||
LEFT JOIN vn.sale s ON s.ticketFk = t.id
|
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)
|
AND (s.itemFk = vItemFk OR vItemFk IS NULL)
|
||||||
GROUP BY t.id
|
GROUP BY t.id
|
||||||
)SELECT ticketFk, ticket_isTooLittle(ticketFk) hasProblem
|
)SELECT ticketFk, ticket_isTooLittle(ticketFk) hasProblem
|
||||||
|
|
|
@ -20,7 +20,7 @@ FROM (
|
||||||
`vn`.`saleGroup` `sg`
|
`vn`.`saleGroup` `sg`
|
||||||
JOIN `vn`.`saleGroupDetail` `sgd` ON(`sgd`.`saleGroupFk` = `sg`.`id`)
|
JOIN `vn`.`saleGroupDetail` `sgd` ON(`sgd`.`saleGroupFk` = `sg`.`id`)
|
||||||
)
|
)
|
||||||
JOIN `vn`.`sale` `s` ON(`s`.`id` = `sgd`.`saleFk`)
|
JOIN `vn`.`sale` `s` FORCE INDEX (PRIMARY) ON(`s`.`id` = `sgd`.`saleFk`)
|
||||||
)
|
)
|
||||||
JOIN `vn`.`ticketState` `tls` ON(`tls`.`ticketFk` = `s`.`ticketFk`)
|
JOIN `vn`.`ticketState` `tls` ON(`tls`.`ticketFk` = `s`.`ticketFk`)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue