summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--update_reserved_status.ktr7
1 files changed, 4 insertions, 3 deletions
diff --git a/update_reserved_status.ktr b/update_reserved_status.ktr
index 6499be5..6294745 100644
--- a/update_reserved_status.ktr
+++ b/update_reserved_status.ktr
@@ -741,7 +741,7 @@ else{
--and (sp.state_reserve not in ('done', 'cancel') or sp.state_reserve is null)
--and sp.write_date >= (now() - '180 days'::interval)
--group by sp.id
-select sp.id as picking_id, sp.state, sum(coalesce(sm.product_uom_qty,0)) as qty_need,
+select sp.id as picking_id, sp.state, sp.state_reserve, sum(coalesce(sm.product_uom_qty,0)) as qty_need,
sum(coalesce(sml.product_uom_qty,0)) as qty_reserved, sum(coalesce(sml.qty_done,0)) as qty_done,
sp.date_reserved, now()::timestamp-'7 hours'::interval as current_date
from stock_picking sp
@@ -753,8 +753,9 @@ where 1=1
and (sp.picking_type_id = 29 or sp.picking_type_id = 30)
and (sp.state_reserve not in ('done', 'cancel') or sp.state_reserve is null)
and sp.write_date >= (now() - '180 days'::interval)
---and sp.state in ('assigned', 'confirmed', 'draft')
-group by sp.id </sql>
+--and sp.name ILIKE '%BU/OUT%'
+and sp.state in ('assigned', 'confirmed', 'draft', 'waiting')
+group by sp.id </sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>