7383-testToMaster #2445
|
@ -34,7 +34,7 @@ BEGIN
|
|||
clientFk,
|
||||
companyFk,
|
||||
margin
|
||||
)WITH calculated AS(
|
||||
)WITH calculatedSales AS(
|
||||
SELECT s.id saleFk,
|
||||
SUM(IF(ct.isBase, s.quantity * sc.value, 0)) amount,
|
||||
SUM(IF(ct.isBase, 0, s.quantity * sc.value)) surcharge,
|
||||
|
@ -64,7 +64,7 @@ BEGIN
|
|||
clientFk,
|
||||
companyFk,
|
||||
marginComponents + amount + surcharge - pvp
|
||||
FROM calculated;
|
||||
FROM calculatedSales;
|
||||
|
||||
SET vLoopDate = vLoopDate + INTERVAL 1 DAY;
|
||||
END WHILE;
|
||||
|
|
Loading…
Reference in New Issue