This commit is contained in:
parent
31c89538bc
commit
3cde6b6bc6
|
@ -34,6 +34,7 @@ proc: BEGIN
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
SET vDateSumFrom = vDateSumTo - INTERVAL vScopeDays DAY;
|
SET vDateSumFrom = vDateSumTo - INTERVAL vScopeDays DAY;
|
||||||
|
SET vDateSumTo = vDateSumTo - INTERVAL 1 DAY;
|
||||||
|
|
||||||
INSERT INTO itemCampaign(dated, itemFk, quantity, total, campaign)
|
INSERT INTO itemCampaign(dated, itemFk, quantity, total, campaign)
|
||||||
SELECT vYesterday,
|
SELECT vYesterday,
|
||||||
|
@ -44,7 +45,7 @@ proc: BEGIN
|
||||||
FROM sale s
|
FROM sale s
|
||||||
JOIN ticket t ON t.id = s.ticketFk
|
JOIN ticket t ON t.id = s.ticketFk
|
||||||
JOIN client c ON c.id = t.clientFk
|
JOIN client c ON c.id = t.clientFk
|
||||||
WHERE t.shipped BETWEEN vDateSumFrom AND vDateSumTo
|
WHERE t.shipped BETWEEN vDateSumFrom AND util.dayEnd(vDateSumTo)
|
||||||
AND c.typeFk = 'normal'
|
AND c.typeFk = 'normal'
|
||||||
AND NOT t.isDeleted
|
AND NOT t.isDeleted
|
||||||
GROUP BY s.itemFk
|
GROUP BY s.itemFk
|
||||||
|
|
Loading…
Reference in New Issue