incrememnt to next year

This commit is contained in:
Paul Trowbridge 2021-04-05 12:02:03 -04:00
parent c4f3abd733
commit fd855cda72
3 changed files with 45 additions and 12 deletions

View File

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

33
build/rec_act.sql Normal file
View File

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

View File

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