Commit Graph

624 Commits

Author SHA1 Message Date
PhilRunninger
0d83f19e33 Fix percent change calculation for price adjustment.
I shouldn't be coding on zero hours sleep!
2023-05-17 10:04:46 -04:00
PhilRunninger
47d1baffc5 Handle the case where baseline is zero (units or value).
This happens when a customer places identical orders and specifies that
they be shipped in different seasons. We end up with one order shipped
in 2023 and one open for 2024. Under our current operating procedures,
open orders are subtracted from shipped orders and are presented as
baseline for the next forecast. The zero that appears in the baseline in
this case was causing all kinds of issues in the SQL scripts for
inserting the adjustments, ranging from finding zero rows to adjust to
division by zero.

Another change required to correct this was updating the iter value of
the open orders from 'actuals' to 'copy':

    UPDATE rlarp.osm_pool
    SET iter = 'copy'
    WHERE tag = 'open-orders'
2023-05-17 05:28:21 -04:00
PhilRunninger
7e82b37fb1 Merge branch 'master' of github.com:The-HC-Companies/forecast_api 2023-05-09 01:26:10 -04:00
PhilRunninger
eb03d61600 Add options to query by director or segment. Also speed it up A LOT. 2023-05-09 01:24:08 -04:00
f47571c1e2 Extend minimum order_date back one additional year in the past. 2023-05-08 10:05:55 -04:00
PhilRunninger
cecd647ee7 Prevent accidental undo of initial baseline load. 2023-05-03 15:34:17 -04:00
PhilRunninger
9e1299e49c Minor tweaks to the spreadsheet, version 17.0 in Teams. No VBA changes. 2023-05-03 15:33:52 -04:00
PhilRunninger
5fe17549ab Fix bug caused by my putting headers where they shouldn't be. 2023-05-01 21:03:32 -04:00
PhilRunninger
da28aa485f Keep Data sheet visible. This coincides with version 13.0 in Teams. 2023-05-01 13:49:13 -04:00
PhilRunninger
4504cbaa2a Improve log messages in the server console log.
* More informative.
* Better timing in the code, so always displayed.
* Used string interpolation instead of concatenation for readability.
2023-04-28 10:27:27 -04:00
PhilRunninger
86225ea7e5 Get pounds to update for each forecast adjustment.
Lots of cleanup here too, removing large swaths of code that are no
longer needed. Many improvements the Excel workbook, which is kept in
Teams, not git. These changes may or may not have had accompanying VBA
changes.
2023-04-27 16:54:37 -04:00
PhilRunninger
fde6c97964 Too many changes, too few commits.
A lot has changed here, including:
1. Adding pounds to the data available for display in pivot table.
2. Visual improvements
3. Code simplification
4. Hiding / showing sheets as needed. A developer's backdoor allows for
   easy toggling for debugging purposes: Ctrl+RightClick on the Forecast
   Adjustment form's "Selected Scenario" label.
5. Fixed a bug that happened when deleting rows from the basket. The
   definition of the Target variable was lost in some cases.
6. Made use of the Cancel and Default form properties to purge some
   unnecessary code.
7. Added a sheet that contains Help text for the users.
8. Replacing more harcoded range reference with range names.
9. Refactor checks for division by zero errors, and improve error
   messages for users.
10. Remove manual formatting. It's already done and saved in the
    workbook; there's no need to redo it in code.
11. Added more data validation before Save operation proceeds.
12. Added a new IntersectsWith function to simplify If statements.
2023-04-24 21:46:13 -04:00
PhilRunninger
81174b5d57 UI and UX Changes
1. Remove/Hide Swap Part
2. Remove/Hide Swap Customer
3. Improved the location of controls on fpvt form.
4. Make user experience more intuitive on the Month sheet
5. Make more and better use of named ranges in place of hardcoded cell
   locations.
6. Added error checking to ensure Tag is entered and at least one month
   has a forecast on Month sheet.
2023-04-05 17:51:50 -04:00
12c17b0be6 adjust rep source to rlarp.repc, adjust join logic to match current osm definition 2023-04-05 13:02:53 -04:00
PhilRunninger
480adef789 Update some 2022 references to 2024, and fix round() function calls. 2023-04-05 12:37:35 -04:00
PhilRunninger
bbac2ec390 Remove the code from the Walk sheet. Actually, just comment it out. 2023-03-22 12:05:36 -04:00
PhilRunninger
85829efd1d Clean up the VBA. This coincides with version 10.0 in Teams.
WARNING!  Do not assume the Excel file in this repo matches the VBA in
the repo. The decision was made to use Teams for managing changes to the
Excel tamplate because Git is ill-suited for binary files. The Excel
file will be updated from time to time, but only when something major
happens with the application as a whole.

1. Use the sheets' codenames to refer to them in code. This prevents
   breakage if the user changes the sheet name while working with the
   workbook.
2. Give the pivot tables proper, if not descriptive, names.
3. Simplify the code that detects a double-click in the pivot table.
4. Remove Windows_API as it was not being used.
5. Pare down TheBigOne to just the essential functions in Utils.
6. Refer to the data sources for the userforms' listboxes by using the
   worksheet.ListObjects collection.
2023-03-09 10:32:58 -05:00
ef8a21d319 update rebuild script 2023-03-08 08:48:02 -05:00
cc656d7c24 increment dates 2023-03-07 17:32:45 -05:00
5e7ad3b208 swap everything for a 2109 baseline 2023-03-07 16:45:55 -05:00
15da8aecd4 reports 2023-03-07 16:07:55 -05:00
6f88ed618d include all foreast since the piece labeled actuals actually forms a current year forecast 2023-03-07 15:44:25 -05:00
d79feebaa5 dont load anything to staged forecast that has "actuals" in it 2023-03-07 15:27:33 -05:00
0ae9f604c1 change version to b23 2023-03-07 12:39:30 -05:00
a0c5482f6c update convert pool to target osmfs in its current state 2023-03-07 11:44:22 -05:00
ef0c9175cd increment years and target iterations 2023-03-06 09:38:57 -05:00
304aeababa include Phils new modules 2023-03-03 17:07:28 -05:00
2c63d400f7 save my version that was on teams as 1.7 2023-03-03 14:32:10 -05:00
98ed8c52dc export VBA files for version 1.7 on teams 2023-03-03 14:29:04 -05:00
PhilRunninger
8809cb9ad4 Added PrintJSON function for debugging the JSON object variables. 2023-03-03 14:16:59 -05:00
PhilRunninger
bd8aa18208 Merge branch 'dev' of github.com:The-HC-Companies/forecast_api into dev 2023-03-01 18:00:18 -05:00
PhilRunninger
bfcf8ff4b4 Keeping the workbook in sync with other code. 2023-03-01 17:56:36 -05:00
PhilRunninger
ed5975daf7 Switch source table from rlarp.itemmv to "CMS.CUSLG".itemm 2023-03-01 17:55:30 -05:00
PhilRunninger
59cb926d9c Make the log statements unique for each route. 2023-03-01 17:51:01 -05:00
5dc5a11489 increment year 2023-03-01 17:07:44 -05:00
fd4079cb17 clean up 2023-03-01 16:32:52 -05:00
e5db7372a1 repoint snaps 2023-03-01 16:07:36 -05:00
7d901e7f42 new forecast baseline dates 2023-03-01 16:01:32 -05:00
PhilRunninger
bc9aa4a456 Merge branch 'new_parser' into dev 2023-02-28 15:10:21 -05:00
PhilRunninger
3b72871cc6 Renamed the pivot tables, and simplified some code.
I made the "did I double click in the pivot table?" code work more
efficiently.
2023-02-28 15:05:54 -05:00
PhilRunninger
8ba18476d8 Include new JSON parser for evaluation. Is it better? 2023-02-27 16:26:12 -05:00
PhilRunninger
5b507d3d65 Updates to the newest season in scenario_package.sql 2023-02-27 16:15:35 -05:00
68aa1c219a updates 2023-02-24 19:28:14 -05:00
PhilRunninger
21e72a42cc Update the Excel workbook to the latest version from Teams. 2023-02-22 14:24:39 -05:00
PhilRunninger
70392a6829 Renamed the Excel file. 2023-02-22 14:23:59 -05:00
PhilRunninger
d7d2447be2 Merge branch 'dev' of github.com:The-HC-Companies/forecast_api into dev 2023-02-17 14:24:00 -05:00
PhilRunninger
e1359714cc Upgrade packages for use in node version 19.5.0. 2023-02-17 14:22:05 -05:00
e73d69ad65 include pool ddl 2023-02-15 14:21:49 -05:00
a66ec61aaf increment iteration name to reflect period 2021-08-03 13:33:37 -04:00
2253d65047 group by percentage of row to keep, and filter out -0- 2021-08-03 08:26:05 -04:00