From fd855cda7279f26bea4ddb1e8b4598e08a8f108e Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 5 Apr 2021 12:02:03 -0400 Subject: [PATCH] incrememnt to next year --- build/check_osmf_match.sql | 8 ++++---- build/rec_act.sql | 33 +++++++++++++++++++++++++++++++++ build/snap_fx.sql | 16 ++++++++-------- 3 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 build/rec_act.sql diff --git a/build/check_osmf_match.sql b/build/check_osmf_match.sql index fda0286..88ef531 100644 --- a/build/check_osmf_match.sql +++ b/build/check_osmf_match.sql @@ -1,10 +1,10 @@ SELECT order_season - ,sum(value_usd) value_usd + ,sum(coalesce(value_usd,0)) value_usd FROM rlarp.osm_pool WHERE - order_season = 2021 + order_season = 2022 --AND version = 'b21' GROUP BY order_season @@ -15,8 +15,8 @@ SELECT FROM rlarp.osmf_dev WHERE - oseas = 2021 - AND version = 'b21' + oseas = 2022 + AND version = 'b22' GROUP BY oseas diff --git a/build/rec_act.sql b/build/rec_act.sql new file mode 100644 index 0000000..fa0bed2 --- /dev/null +++ b/build/rec_act.sql @@ -0,0 +1,33 @@ + SELECT + oseas + ,go.drange + ,go.sspr + ,sum(fb_val_loc * r_rate) + FROM + rlarp.osm_dev o + --snap the ship dates of the historic fiscal period + --LEFT OUTER JOIN rlarp.gld ON + -- gld.fspr = o.fspr + LEFT OUTER JOIN rlarp.gld go ON + odate between go.sdat and go.edat + --get the shipping season for open orders based on the snapped date + --LEFT OUTER JOIN rlarp.gld ss ON + -- greatest(least(o.sdate,gld.edat),gld.sdat) BETWEEN ss.sdat AND ss.edat + WHERE + ( + --base period orders booked.... + o.odate BETWEEN '2020-06-01' AND '2021-04-04' + ----...or any open orders currently booked before cutoff.... + --OR (o.calc_status IN ('OPEN','BACKORDER') and o.odate < '2021-04-04') + ----...or anything that shipped in that period + --OR o.fspr BETWEEN '2101' AND '2110' + ) + AND fs_line = '41010' + AND calc_status <> 'CANCELED' + --AND NOT (calc_status = 'CLOSED' AND flag = 'REMAINDER') + ---exclude integrated quotes---- + AND version = 'ACTUALS' + GROUP BY + oseas + ,go.drange + ,go.sspr diff --git a/build/snap_fx.sql b/build/snap_fx.sql index 606d732..437cd1c 100644 --- a/build/snap_fx.sql +++ b/build/snap_fx.sql @@ -1,9 +1,9 @@ ------------update fx rates----------------------------------------------------------------- -UPDATE rlarp.osmf_dev SET r_rate = .7518 WHERE r_currency = 'CA' AND version = 'b21'; -UPDATE rlarp.osmf_dev SET r_rate = 1.0000 WHERE r_currency = 'US' AND version = 'b21'; -UPDATE rlarp.osmf_dev SET c_rate = .7518 WHERE c_currency = 'CA' AND version = 'b21'; -UPDATE rlarp.osmf_dev SET c_rate = 1.0000 WHERE c_currency = 'US' AND version = 'b21'; -UPDATE rlarp.osm_pool SET r_rate = .7518 WHERE r_currency = 'CA' AND version = 'b21'; -UPDATE rlarp.osm_pool SET value_usd = value_loc * r_rate WHERE r_currency = 'CA' AND version = 'b21'; -UPDATE rlarp.osm_pool SET c_rate = .7518 WHERE c_currency = 'CA' AND version = 'b21'; -UPDATE rlarp.osm_pool SET cost_usd = cost_loc * c_rate WHERE c_currency = 'CA' AND version = 'b21'; \ No newline at end of file +UPDATE rlarp.osmf_dev SET r_rate = .7597 WHERE r_currency = 'CA' AND version = 'b22'; +UPDATE rlarp.osmf_dev SET r_rate = 1.0000 WHERE r_currency = 'US' AND version = 'b22'; +UPDATE rlarp.osmf_dev SET c_rate = .7597 WHERE c_currency = 'CA' AND version = 'b22'; +UPDATE rlarp.osmf_dev SET c_rate = 1.0000 WHERE c_currency = 'US' AND version = 'b22'; +UPDATE rlarp.osm_pool SET r_rate = .7597 WHERE r_currency = 'CA' AND version = 'b22'; +UPDATE rlarp.osm_pool SET value_usd = value_loc * r_rate WHERE r_currency = 'CA' AND version = 'b22'; +UPDATE rlarp.osm_pool SET c_rate = .7597 WHERE c_currency = 'CA' AND version = 'b22'; +UPDATE rlarp.osm_pool SET cost_usd = cost_loc * c_rate WHERE c_currency = 'CA' AND version = 'b22';