diff --git a/build/merge_actuals_exec.sql b/build/merge_actuals_exec.sql index 852c99b..f263fae 100644 --- a/build/merge_actuals_exec.sql +++ b/build/merge_actuals_exec.sql @@ -1,3 +1,3 @@ -DELETE FROM rlarp.osmf_dev WHERE odate < '2020-05-01'; -INSERT INTO rlarp.osmf_dev SELECT * FROM rlarp.osmfs_dev WHERE odate < '2020-05-01'; \ No newline at end of file +DELETE FROM rlarp.osmf_dev WHERE odate < '2020-06-01'; +INSERT INTO rlarp.osmf_dev SELECT * FROM rlarp.osmfs_dev WHERE odate < '2020-06-01'; diff --git a/build/merge_actuals_pool.sql b/build/merge_actuals_pool.sql index 369f2be..fcf2be9 100644 --- a/build/merge_actuals_pool.sql +++ b/build/merge_actuals_pool.sql @@ -1,6 +1,6 @@ BEGIN; -DELETE FROM rlarp.osm_pool WHERE order_date < '2020-05-01'; +DELETE FROM rlarp.osm_pool WHERE order_date < '2020-06-01'; INSERT INTO rlarp.osm_pool WITH @@ -134,7 +134,7 @@ FROM LEFT OUTER JOIN rlarp.itemm i ON i.item = o.part WHERE - odate < '2020-05-01'; + odate < '2020-06-01'; SELECT @@ -160,4 +160,4 @@ GROUP BY --ROLLBACK; -commit; \ No newline at end of file +commit; diff --git a/build/merge_actuals_prep.sql b/build/merge_actuals_prep.sql index 513d845..dbc4343 100644 --- a/build/merge_actuals_prep.sql +++ b/build/merge_actuals_prep.sql @@ -145,11 +145,11 @@ gld AS ( WHERE ( --base period orders booked.... - o.odate <@ daterange('2019-06-01','2020-05-01') + o.odate <@ daterange('2019-06-01','2020-06-01') --...or any open orders currently booked before cutoff.... - OR (o.calc_status IN ('OPEN','BACKORDER') and o.odate < '2020-05-01') + OR (o.calc_status IN ('OPEN','BACKORDER') and o.odate < '2020-06-01') --...or anything that shipped in that period - OR o.fspr BETWEEN '2001' AND '2011' + OR o.fspr BETWEEN '2001' AND '2012' ) AND fs_line = '41010' AND calc_status <> 'CANCELED' @@ -184,4 +184,4 @@ SELECT * FROM baseline; --UPDATE rlarp.osmfs SET iter = 'short ship' WHERE calc_status = 'CLOSED' AND flag = 'REMAINDER'; ---identify goofy ship dates: causes disconnect with sales when splicing in a forecast that has this problem------------------- ---UPDATE rlarp.osmfs SET iter = 'bad date' WHERE adj_shipdate < adj_orderdate; \ No newline at end of file +--UPDATE rlarp.osmfs SET iter = 'bad date' WHERE adj_shipdate < adj_orderdate; diff --git a/build/snap_cust_pool.sql b/build/snap_cust_pool.sql index df91ed4..a891cb8 100644 --- a/build/snap_cust_pool.sql +++ b/build/snap_cust_pool.sql @@ -82,7 +82,7 @@ WHERE b.bvcust = rtrim(substring(o.bill_cust_descr,1,8)) AND s.bvcust = rtrim(substring(o.ship_cust_descr,1,8)); -BEGIN; +--BEGIN; UPDATE rlarp.osm_pool o @@ -97,5 +97,5 @@ WHERE and c.a2 = 'MM' AND q.qr = LTRIM(RTRIM(c.a9)); - -ROLLBACK; \ No newline at end of file +COMMIT; +--ROLLBACK;