increment periods
This commit is contained in:
parent
76edca43dc
commit
8a3baf269d
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
DELETE FROM rlarp.osmf_dev WHERE odate < '2020-05-01';
|
DELETE FROM rlarp.osmf_dev WHERE odate < '2020-06-01';
|
||||||
INSERT INTO rlarp.osmf_dev SELECT * FROM rlarp.osmfs_dev WHERE odate < '2020-05-01';
|
INSERT INTO rlarp.osmf_dev SELECT * FROM rlarp.osmfs_dev WHERE odate < '2020-06-01';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
BEGIN;
|
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
|
INSERT INTO rlarp.osm_pool
|
||||||
WITH
|
WITH
|
||||||
@ -134,7 +134,7 @@ FROM
|
|||||||
LEFT OUTER JOIN rlarp.itemm i ON
|
LEFT OUTER JOIN rlarp.itemm i ON
|
||||||
i.item = o.part
|
i.item = o.part
|
||||||
WHERE
|
WHERE
|
||||||
odate < '2020-05-01';
|
odate < '2020-06-01';
|
||||||
|
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
@ -160,4 +160,4 @@ GROUP BY
|
|||||||
|
|
||||||
--ROLLBACK;
|
--ROLLBACK;
|
||||||
|
|
||||||
commit;
|
commit;
|
||||||
|
@ -145,11 +145,11 @@ gld AS (
|
|||||||
WHERE
|
WHERE
|
||||||
(
|
(
|
||||||
--base period orders booked....
|
--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 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 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 fs_line = '41010'
|
||||||
AND calc_status <> 'CANCELED'
|
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';
|
--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-------------------
|
---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;
|
--UPDATE rlarp.osmfs SET iter = 'bad date' WHERE adj_shipdate < adj_orderdate;
|
||||||
|
@ -82,7 +82,7 @@ WHERE
|
|||||||
b.bvcust = rtrim(substring(o.bill_cust_descr,1,8))
|
b.bvcust = rtrim(substring(o.bill_cust_descr,1,8))
|
||||||
AND s.bvcust = rtrim(substring(o.ship_cust_descr,1,8));
|
AND s.bvcust = rtrim(substring(o.ship_cust_descr,1,8));
|
||||||
|
|
||||||
BEGIN;
|
--BEGIN;
|
||||||
|
|
||||||
UPDATE
|
UPDATE
|
||||||
rlarp.osm_pool o
|
rlarp.osm_pool o
|
||||||
@ -97,5 +97,5 @@ WHERE
|
|||||||
and c.a2 = 'MM'
|
and c.a2 = 'MM'
|
||||||
AND q.qr = LTRIM(RTRIM(c.a9));
|
AND q.qr = LTRIM(RTRIM(c.a9));
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
ROLLBACK;
|
--ROLLBACK;
|
||||||
|
Loading…
Reference in New Issue
Block a user