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