feat: refs #8119 itemCampaignQuantity #3117

Merged
guillermo merged 20 commits from 8119-itemCampaignQuantity into master 2024-10-23 10:40:43 +00:00
1 changed files with 5 additions and 3 deletions
Showing only changes of commit 3628abd5bf - Show all commits

View File

@ -12,13 +12,15 @@ proc: BEGIN
* @param vDateTo Fecha hasta
* @param vCampaign Código de la campaña
*/
DECLARE vYesterday INT;
DECLARE vCurdate DATE;
DECLARE vYesterday DATE;
DECLARE vDefaultCampaign VARCHAR(100);
DECLARE vPreviousDaysToInsert INT;
DECLARE vDateSumFrom DATE;
DECLARE vDateSumTo DATE;
DECLARE vScopeDays DATE;
SET vCurdate = util.VN_CURDATE();
SET vYesterday = util.yesterday();
IF vDateFrom IS NULL THEN
@ -47,7 +49,7 @@ proc: BEGIN
SELECT dated, scopeDays INTO vDateSumTo, vScopeDays
FROM campaign
WHERE dated > util.VN_CURDATE()
WHERE dated > vCurdate
AND code = vCampaign
ORDER BY dated
LIMIT 1;
@ -56,7 +58,7 @@ proc: BEGIN
CALL util.throw('Missing data in campaign table');
END IF;
IF NOT util.VN_CURDATE() BETWEEN vDateSumTo - INTERVAL vPreviousDaysToInsert DAY
IF NOT vCurdate BETWEEN vDateSumTo - INTERVAL vPreviousDaysToInsert DAY
AND vDateSumTo THEN
LEAVE proc;
END IF;