Fix r_currency and c_currency. They were swapped. :(

This commit is contained in:
PhilRunninger 2023-08-29 20:30:36 -04:00
parent f0ec96fe2a
commit 123da3ea11

View File

@ -90,8 +90,8 @@ FROM
,[Request Month] AS [request_month]
,[Promo Code] AS [promo]
,[Financial Statement Line] as [fs_line]
,[Inventory Currency] as [r_currency]
,[Order Currency] as [c_currency]
,[Order Currency] as [r_currency]
,[Inventory Currency] as [c_currency]
,PRICE.LPP_loc * BASE.Units AS [value_loc]
,PRICE.LPP_USD * BASE.Units AS [value_usd]
,[Standard Cost Local - Historic] AS [cost_loc]
@ -634,9 +634,9 @@ SELECT
,[Segment] AS [segm]
,CASE WHEN [Major Group] LIKE '610%' THEN 'Fiber' ELSE 'Plastic' END [substance]
,[Financial Statement Line] as [fs_line]
,[Inventory Currency] as [r_currency]
,[Inventory Currency] as [c_currency]
,[Value USD]/nullif([Value Local],0) as [r_rate]
,[Order Currency] as [c_currency]
,[Order Currency] as [r_currency]
,[Std Cost USD - Current]/nullif([Std Cost Local - Current],0) as [c_rate]
,[Units] AS [units]
,[value local] AS [value_loc]
@ -668,6 +668,7 @@ UNION ALL
--
-- OPEN ORDERS GOING INTO THE BEGINNING OF 2024 SEASON --
-- THESE WERE BACKED OUT OF THE 2024 BASELINE --
SELECT
CASE
WHEN [Ship Season] IS NULL THEN CAST([Promise Season] % 100 AS varchar) + LEFT([Promise Month], 2)
@ -697,9 +698,9 @@ SELECT
,[Segment] AS [segm]
,CASE WHEN [Major Group] LIKE '610%' THEN 'Fiber' ELSE 'Plastic' END [substance]
,[Financial Statement Line] as [fs_line]
,[Inventory Currency] as [r_currency]
,[Inventory Currency] as [c_currency]
,[Value USD]/nullif([Value Local],0) as [r_rate]
,[Order Currency] as [c_currency]
,[Order Currency] as [r_currency]
,[Std Cost USD - Current]/nullif([Std Cost Local - Current],0) as [c_rate]
,[Units] AS [units]
,[value local] AS [value_loc]
@ -717,6 +718,7 @@ SELECT
,[Ship Date] AS [ship_date]
,[Ship Month] AS [ship_month]
,[Ship Season] AS [ship_season]
,[Promise Date]
,'b24' AS [version]
,'actuals' AS [iter]
,1 AS [logid]