increment periods

This commit is contained in:
Paul Trowbridge 2020-06-07 22:43:50 -04:00
parent 76edca43dc
commit 8a3baf269d
4 changed files with 12 additions and 12 deletions

View File

@ -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';

View File

@ -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

View File

@ -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'

View File

@ -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;