Go to file
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
build Fix r_currency and c_currency. They were swapped. :( 2023-08-29 20:30:36 -04:00
inquirey swap everything for a 2109 baseline 2023-03-07 16:45:55 -05:00
Master Template.xlsm_EXPORTS Make the VBA handle pivot fields in the filters section. 2024-03-19 16:21:18 -04:00
offline Switch source table from rlarp.itemmv to "CMS.CUSLG".itemm 2023-03-01 17:55:30 -05:00
route_sql Fix the pscale adjustment factor when adding month data. 2024-03-19 16:24:04 -04:00
VBA Batch error messages and identify period to which they apply. 2023-08-31 17:07:58 -04:00
.env.sample populate sample env 2020-02-11 11:06:13 -05:00
.gitignore include pool ddl 2023-02-15 14:21:49 -05:00
columns.md add substance column and move some files out of the route folder that aren't actually being used by routes 2020-02-19 13:25:28 -05:00
create_certs.sh add pieces to get the server running 2020-02-05 23:41:57 -05:00
forecast_api.service updates 2023-02-24 19:28:14 -05:00
index.js Show more of the response in the journal. 2024-03-13 08:45:21 -04:00
LICENSE Create LICENSE 2019-03-12 14:31:39 -04:00
Master Template.xlsm Make the VBA handle pivot fields in the filters section. 2024-03-19 16:21:18 -04:00
msauth.html change header 2019-03-19 00:13:12 -04:00
package-lock.json Upgrade packages for use in node version 19.5.0. 2023-02-17 14:22:05 -05:00
package.json Upgrade packages for use in node version 19.5.0. 2023-02-17 14:22:05 -05:00
README.md Update README.md 2021-07-12 14:44:56 -04:00
sample_request.json move files around 2020-02-19 17:05:27 -05:00

This will not work without exactly the right database schema which is out of scope. this is only the running process part of the forecast.

Setup

  • git clone (to //opt for verbatim use of the .service file)
  • npm install
  • create certs: chmod 700 create_certs.sh , ./create_certs.sh
  • clone sample env cp .env.sample .env and specify 1) database creds 2) working directory 3) listening port
  • run: node index.js
  • navigate to https://localhost:8080/ to valide it's connectable
  • open the spreadsheet and specify the target connection

additionally, to setup as service

  • copy .service file to //etc/systemd/system/ (adjust user/working direct if needed)
  • sudo systemctl enable forecast_api.service

Initial Forecast

  • all SQL depends on unchanged core sales matrix table schema