Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
5339dcbf19
|
@ -25,10 +25,7 @@ BEGIN
|
||||||
IF(
|
IF(
|
||||||
aw.`type` = 'external',
|
aw.`type` = 'external',
|
||||||
(b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity,
|
(b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity,
|
||||||
IF(c.code = 'manaClaim',
|
0
|
||||||
sc.value * s.quantity,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
FROM vn.sale s
|
FROM vn.sale s
|
||||||
|
@ -41,10 +38,8 @@ BEGIN
|
||||||
JOIN cache.last_buy lb ON lb.item_id = i.id
|
JOIN cache.last_buy lb ON lb.item_id = i.id
|
||||||
AND lb.warehouse_id = w.id
|
AND lb.warehouse_id = w.id
|
||||||
JOIN vn.buy b ON b.id = lb.buy_id
|
JOIN vn.buy b ON b.id = lb.buy_id
|
||||||
LEFT JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
|
||||||
LEFT JOIN vn.component c ON c.id = sc.componentFk
|
|
||||||
WHERE t.shipped BETWEEN vDateFrom AND vDateTo
|
WHERE t.shipped BETWEEN vDateFrom AND vDateTo
|
||||||
AND w.isManaged
|
AND w.isManaged
|
||||||
GROUP BY it.id, i.id;
|
GROUP BY i.id;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue