forecast_api/route_sql
PhilRunninger c7789f868c Fix the pscale adjustment factor when adding month data.
Two things were wrong with this code:
1. The exchange rate conversion was backward. Since we work in USD, I
   removed the conversion and used value_usd instead.
2. The calculation of pscale.factor was incorrect. If the old value is
   1000, and we need to get to 1020, the record to be inserted must have
   a value of 20, thus the value for factor needs to be:
   (1020 - 1000) / 1000  =  (1020 / 1000) - 1  =  0.02
   0.02 * 1000  =  20, which is inserted in the new record.

   The subtraction was missing before, which of course caused WAY wrong
   numbers that should have been caught a long time ago. It was doing:
   1020 / 1000  =  1.02
   1.02 * 1000 = 1020 was inserted, doubling the intended adjustment.
2024-03-19 16:24:04 -04:00
..
addmonth_vupd.sql Fix the pscale adjustment factor when adding month data. 2024-03-19 16:24:04 -04:00
adj_totals.sql Update some 2022 references to 2024, and fix round() function calls. 2023-04-05 12:37:35 -04:00
get_pool.sql Add options to query by director or segment. Also speed it up A LOT. 2023-05-09 01:24:08 -04:00
list_changes.sql Omit from the list, the one adjustment that can't be undone. 2023-08-30 10:32:57 -04:00
new_basket.sql Use a pre-authorized, fixed exchange rate of 0.7409 for forecasting. 2024-03-18 21:23:07 -04:00
scale_pd.sql Make debugging statements in SQL files more informative. 2024-03-13 08:50:50 -04:00
scale_vd.sql Make debugging statements in SQL files more informative. 2024-03-13 08:50:50 -04:00
scale_vupd_sales.sql Update some 2022 references to 2024, and fix round() function calls. 2023-04-05 12:37:35 -04:00
scale_vupd.sql Make debugging statements in SQL files more informative. 2024-03-13 08:50:50 -04:00
scenario_package.sql Make SQL changes to advance to the next season. 2024-03-13 09:03:16 -04:00
swap_cust.sql populate dsm when swapping customers, rework pool quate rep snap 2021-04-16 13:57:32 -04:00
swap_fit.sql Make SQL changes to advance to the next season. 2024-03-13 09:03:16 -04:00
swap_post.sql Switch source table from rlarp.itemmv to "CMS.CUSLG".itemm 2023-03-01 17:55:30 -05:00
undo.sql Prevent accidental undo of initial baseline load. 2023-05-03 15:34:17 -04:00