7691-testToMaster #2703
|
@ -68,7 +68,7 @@ BEGIN
|
|||
DATE(t.shipped),
|
||||
-LEAST(s.quantity,0) `in`,
|
||||
GREATEST(s.quantity,0) `out`,
|
||||
t.warehouseFk,
|
||||
w.name,
|
||||
s.price * (100 - s.discount) / 100
|
||||
FROM sale s
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
|
@ -76,6 +76,7 @@ BEGIN
|
|||
JOIN ticket t ON t.id = s.ticketFk
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
JOIN supplier su ON su.nif = c.fi
|
||||
JOIN warehouse w ON w.id = t.warehouseFk
|
||||
WHERE su.id = vSupplierFk
|
||||
AND t.shipped >= vFromDated
|
||||
AND p.isPackageReturnable
|
||||
|
@ -110,7 +111,7 @@ BEGIN
|
|||
DATE(t.shipped),
|
||||
-LEAST(tp.quantity,0) `in`,
|
||||
GREATEST(tp.quantity,0) `out`,
|
||||
t.warehouseFk,
|
||||
w.name,
|
||||
0
|
||||
FROM ticketPackaging tp
|
||||
JOIN packaging p ON p.id = tp.packagingFk
|
||||
|
@ -118,6 +119,7 @@ BEGIN
|
|||
JOIN ticket t ON t.id = tp.ticketFk
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
JOIN supplier su ON su.nif = c.fi
|
||||
JOIN warehouse w ON w.id = t.warehouseFk
|
||||
WHERE su.id = vSupplierFk
|
||||
AND t.shipped >= vFromDated
|
||||
AND p.isPackageReturnable
|
||||
|
|
Loading…
Reference in New Issue