From 31d6cd36d3ac0ba91146c65f88e1e355980d476a Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 15 Apr 2025 10:36:40 +0700 Subject: bf --- collect_fulfillment.ktr | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'collect_fulfillment.ktr') diff --git a/collect_fulfillment.ktr b/collect_fulfillment.ktr index 1956379..9896b66 100644 --- a/collect_fulfillment.ktr +++ b/collect_fulfillment.ktr @@ -1091,17 +1091,7 @@ 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 ---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 + 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 @@ -1110,8 +1100,8 @@ 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 +group by sm.sale_line_id,sml.product_id +order by sm.sale_line_id,sml.product_id 0 N -- cgit v1.2.3