incrememnt to next year
This commit is contained in:
parent
c4f3abd733
commit
fd855cda72
@ -1,10 +1,10 @@
|
|||||||
SELECT
|
SELECT
|
||||||
order_season
|
order_season
|
||||||
,sum(value_usd) value_usd
|
,sum(coalesce(value_usd,0)) value_usd
|
||||||
FROM
|
FROM
|
||||||
rlarp.osm_pool
|
rlarp.osm_pool
|
||||||
WHERE
|
WHERE
|
||||||
order_season = 2021
|
order_season = 2022
|
||||||
--AND version = 'b21'
|
--AND version = 'b21'
|
||||||
GROUP BY
|
GROUP BY
|
||||||
order_season
|
order_season
|
||||||
@ -15,8 +15,8 @@ SELECT
|
|||||||
FROM
|
FROM
|
||||||
rlarp.osmf_dev
|
rlarp.osmf_dev
|
||||||
WHERE
|
WHERE
|
||||||
oseas = 2021
|
oseas = 2022
|
||||||
AND version = 'b21'
|
AND version = 'b22'
|
||||||
GROUP BY
|
GROUP BY
|
||||||
oseas
|
oseas
|
||||||
|
|
||||||
|
33
build/rec_act.sql
Normal file
33
build/rec_act.sql
Normal 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
|
@ -1,9 +1,9 @@
|
|||||||
------------update fx rates-----------------------------------------------------------------
|
------------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 = .7597 WHERE r_currency = 'CA' AND version = 'b22';
|
||||||
UPDATE rlarp.osmf_dev SET r_rate = 1.0000 WHERE r_currency = 'US' AND version = 'b21';
|
UPDATE rlarp.osmf_dev SET r_rate = 1.0000 WHERE r_currency = 'US' AND version = 'b22';
|
||||||
UPDATE rlarp.osmf_dev SET c_rate = .7518 WHERE c_currency = 'CA' AND version = 'b21';
|
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 = 'b21';
|
UPDATE rlarp.osmf_dev SET c_rate = 1.0000 WHERE c_currency = 'US' AND version = 'b22';
|
||||||
UPDATE rlarp.osm_pool SET r_rate = .7518 WHERE r_currency = 'CA' AND version = 'b21';
|
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 = 'b21';
|
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 = .7518 WHERE c_currency = 'CA' AND version = 'b21';
|
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 = 'b21';
|
UPDATE rlarp.osm_pool SET cost_usd = cost_loc * c_rate WHERE c_currency = 'CA' AND version = 'b22';
|
||||||
|
Loading…
Reference in New Issue
Block a user