7383-testToMaster #2445

Merged
alexm merged 233 commits from 7383-testToMaster into master 2024-05-14 05:44:13 +00:00
1 changed files with 11 additions and 11 deletions
Showing only changes of commit 4389cd5d74 - Show all commits

View File

@ -72,12 +72,12 @@ proc: BEGIN
CREATE OR REPLACE TEMPORARY TABLE tmp.itemCalc
(INDEX (itemFk,warehouseFk))
ENGINE = MEMORY
SELECT i.item_id itemFk, vWarehouseLanding warehouseFk, i.dat dated, i.amount quantity
FROM vn2008.item_out i
SELECT i.itemFk, vWarehouseLanding warehouseFk, i.shipped dated, i.quantity
FROM vn.itemTicketOut i
JOIN tItemRangeLive ir ON ir.itemFK = i.item_id
WHERE i.dat >= vDatedFrom
AND (ir.dated IS NULL OR i.dat <= ir.dated)
AND i.warehouse_id = vWarehouseLanding
WHERE i.shipped >= vDatedFrom
AND (ir.dated IS NULL OR i.shipped <= ir.dated)
AND i.warehouseFk = vWarehouseLanding
UNION ALL
SELECT b.itemFk, vWarehouseLanding, t.landed, b.quantity
FROM buy b
@ -91,12 +91,12 @@ proc: BEGIN
AND t.landed >= vDatedFrom
AND (ir.dated IS NULL OR t.landed <= ir.dated)
UNION ALL
SELECT i.item_id, vWarehouseLanding, i.dat, i.amount
FROM vn2008.item_entry_out i
JOIN tItemRangeLive ir ON ir.itemFk = i.item_id
WHERE i.dat >= vDatedFrom
AND (ir.dated IS NULL OR i.dat <= ir.dated)
AND i.warehouse_id = vWarehouseLanding
SELECT i.itemFk, vWarehouseLanding, i.shipped, i.quantity
FROM vn.itemEntryOut i
JOIN tItemRangeLive ir ON ir.itemFk = i.itemFk
WHERE i.shipped >= vDatedFrom
AND (ir.dated IS NULL OR i.shipped <= ir.dated)
AND i.warehouseOutFk = vWarehouseLanding
UNION ALL
SELECT r.item_id, vWarehouseLanding, r.shipment, -r.amount
FROM hedera.order_row r