From 8792785ba4ebf79f28d4f10d2438027a44136a7b Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Mon, 14 Apr 2025 17:07:14 +0700 Subject: bug fix qty reserved wms --- collect_fulfillment.ktr | 103 ++++++++++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 51 deletions(-) (limited to 'collect_fulfillment.ktr') diff --git a/collect_fulfillment.ktr b/collect_fulfillment.ktr index 1771619..1956379 100644 --- a/collect_fulfillment.ktr +++ b/collect_fulfillment.ktr @@ -543,6 +543,45 @@ Y + + Add constants + Constant + + Y + + 1 + + none + + + + + created_by_id + Integer + + + + + 1 + -1 + -1 + N + + + + + + + + + + + + 1008 + 224 + Y + + Insert / update InsertUpdate @@ -655,43 +694,33 @@ sale_order_id - sale_order_line_id - product_id - so_qty - current_date - delivered_qty - reserved_stock_qty - po_qty - received_qty - created_by_id - N @@ -1062,7 +1091,17 @@ order by posm.sale_line_id, sml.product_id erp indoteknik production (localhost) - select sm.sale_line_id as sale_order_line_id, sml.product_id, sum(sml.product_uom_qty) as reserved_stock_qty + --select sm.sale_line_id as sale_order_line_id, sml.product_id, sum(sml.product_uom_qty) as reserved_stock_qty +--from stock_move_line sml +--join stock_move sm on sm.id = sml.move_id +--join stock_picking sp on sp.id = sm.picking_id +--where 1=1 +--and sp.state not in ('cancel') +--and sm.sale_line_id is not null +--and sm.write_date >= (now() - '180 days'::interval) +--group by sm.sale_line_id, sml.product_id +--order by sm.sale_line_id, sml.product_id +select sm.sale_line_id as sale_order_line_id, sml.product_id, sum(sml.product_uom_qty) as reserved_stock_qty from stock_move_line sml join stock_move sm on sm.id = sml.move_id join stock_picking sp on sp.id = sm.picking_id @@ -1070,8 +1109,9 @@ where 1=1 and sp.state not in ('cancel') and sm.sale_line_id is not null and sm.write_date >= (now() - '180 days'::interval) +and (sp.name like '%BU/PICK%' or sp.name like '%BU/OUT%') group by sm.sale_line_id, sml.product_id -order by sm.sale_line_id, sml.product_id +order by sm.sale_line_id, sml.product_id 0 N @@ -1459,45 +1499,6 @@ order by sol.id, sol.product_id Y - - Add constants - Constant - - Y - - 1 - - none - - - - - created_by_id - Integer - - - - - 1 - -1 - -1 - N - - - - - - - - - - - - 1008 - 224 - Y - - -- cgit v1.2.3