From 0c394b255746e837c66c9bf5035dce24ac7a91d2 Mon Sep 17 00:00:00 2001 From: Trowbridge Date: Thu, 13 Feb 2020 14:00:04 -0500 Subject: [PATCH] update CTE names, remove volume filter --- route_sql/scale_pd.sql | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/route_sql/scale_pd.sql b/route_sql/scale_pd.sql index 8f61076..b119180 100644 --- a/route_sql/scale_pd.sql +++ b/route_sql/scale_pd.sql @@ -52,11 +52,6 @@ target AS (select target_increment incr) -----------------scenario---------------------------- where_clause -----------------additional params------------------- - AND CASE (SELECT flag FROM flagv) - WHEN 'scale all' THEN true - WHEN 'scale copy' THEN iter = 'copy' - WHEN 'scale new part' THEN module = 'new basket' - END AND calc_status||flag <> 'CLOSEDREMAINDER' --exclude short ships when building order adjustments AND order_date <= ship_date GROUP BY @@ -175,8 +170,8 @@ target AS (select target_increment incr) ,log.doc->>'comment' "comment" ,log.doc->>'type' module FROM - volume b - CROSS JOIN pscale s + basemix b + CROSS JOIN scale s CROSS JOIN log WHERE s.factor <> 0 or s.mod_price <> 0