refactor: refs #7519 Minor change
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-06-03 11:46:52 +02:00
parent 8cef8eace7
commit b8e95c0284
2 changed files with 2 additions and 14 deletions

View File

@ -172,16 +172,14 @@ BEGIN
GROUP BY clientFk
) sub ON sub.clientFk = cr.clientFk
SET cr.priceIncreasing = GREATEST(0, ROUND(IFNULL(sub.greuge, 0) /
(IFNULL(cr.yearSale, 0) * vMonthToRefund / 12 ), 3))
WHERE cr.dated = util.VN_CURDATE();
(IFNULL(cr.yearSale, 0) * vMonthToRefund / 12 ), 3));
-- Protección neonatos
UPDATE claimRatio cr
JOIN firstTicketShipped fts ON fts.clientFk = cr.clientFk
SET cr.priceIncreasing = 0,
cr.claimingRate = 0
WHERE fts.shipped > util.VN_CURDATE() - INTERVAL 1 MONTH
AND cr.dated = util.VN_CURDATE();
WHERE fts.shipped > util.VN_CURDATE() - INTERVAL 1 MONTH;
DROP TEMPORARY TABLE tTicketList;
END$$

View File

@ -1,10 +0,0 @@
UPDATE IGNORE bs.nightTask
SET `procedure` = 'claimRatio_add',
`schema` = 'vn'
WHERE `procedure` = 'claim_ratio_routine';
ALTER TABLE vn.claimRatio ADD dated DATE DEFAULT current_timestamp() NOT NULL;
ALTER TABLE vn.claimRatio CHANGE dated dated DATE DEFAULT current_timestamp() NOT NULL FIRST;
ALTER TABLE vn.claimRatio DROP FOREIGN KEY claimRatio_ibfk_1;
ALTER TABLE vn.claimRatio DROP PRIMARY KEY;
ALTER TABLE vn.claimRatio ADD CONSTRAINT claimRatio_pk PRIMARY KEY (dated,clientFk);