From 04276a89cb0e90e55bed5c7df59faf33c41b5261 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 13 Feb 2020 12:18:32 -0500 Subject: [PATCH] swap out iterdef with module, and point to osm_pool --- route_sql/scale_vupd.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/route_sql/scale_vupd.sql b/route_sql/scale_vupd.sql index 0042a2c..2aaf58d 100644 --- a/route_sql/scale_vupd.sql +++ b/route_sql/scale_vupd.sql @@ -4,9 +4,9 @@ target AS (select target_vol vincr, target_prc pincr) SELECT sum(fb_qty) tot ,sum(fb_qty) FILTER (WHERE iter = 'copy') base - ,sum(fb_qty) FILTER (WHERE iterdef->>'type' = 'new basket') newpart + ,sum(fb_qty) FILTER (WHERE module = 'new basket') newpart FROM - rlarp.osm_fcpool + rlarp.osm_pool WHERE -----------------scenario---------------------------- where_clause @@ -145,7 +145,7 @@ target AS (select target_vol vincr, target_prc pincr) ,null cost_usd ,null units FROM - rlarp.osm_fcpool + rlarp.osm_pool WHERE -----------------scenario---------------------------- where_clause @@ -153,7 +153,7 @@ target AS (select target_vol vincr, target_prc pincr) AND CASE (SELECT flag FROM flagv) WHEN 'scale all' THEN true WHEN 'scale copy' THEN iter = 'copy' - WHEN 'scale new part' THEN iterdef->>'type' = 'new basket' + WHEN 'scale new part' THEN module = 'new basket' END AND calc_status||flag <> 'CLOSEDREMAINDER' --exclude short ships when building order adjustments AND adj_orderdate <= adj_shipdate @@ -496,7 +496,7 @@ target AS (select target_vol vincr, target_prc pincr) ) --select sum(value_usd), sum(fb_qty) from pricing , ins AS ( - INSERT INTO rlarp.osm_fcpool (SELECT * FROM pricing UNION ALL SELECT * FROM volume) RETURNING * + INSERT INTO rlarp.osm_pool (SELECT * FROM pricing UNION ALL SELECT * FROM volume) RETURNING * ) ,insagg AS ( SELECT