feat: refs #8119 itemCampaignQuantity #3117
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue