7336_devToTest #2414

Merged
alexm merged 220 commits from 7336_devToTest into test 2024-05-07 06:26:53 +00:00
1 changed files with 25 additions and 25 deletions
Showing only changes of commit a40545264b - Show all commits

View File

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