Commit Graph

23 Commits

Author SHA1 Message Date
PhilRunninger
f0ec96fe2a Change WHERE clause to remove tag[= or <>]'open-orders' condition.
Now that we think we know what we're doing, I'm using a more rigorous
approach to defining iterations and tags, and this condition is no
longer necessary, and in fact, may be harmful. This I'm removing it.

The initial load of data will have these values.

iter    | tag         | purpose
--------|-------------|-------------------------------------------------
plan    | baseline    | Adjustments will be made to these values only.
actuals | open-orders | Ordered before 2024 season, still open.
actuals | booked      | Ordered in 2024 season so far
2023-08-29 20:02: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
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
28c14ece67 include plan and diff ase baseline iterations 2021-07-16 09:40:34 -04:00
66b74e31cb update all routes to round to 2 decimals for units, value, and cost 2021-04-19 09:20:52 -04:00
Trowbridge
df02a31000 the module is stored as key type in the json 2020-02-25 15:08:01 -05:00
Trowbridge
ff1304be3c 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
Trowbridge
cbc2caa41d add module back in 2020-02-18 17:10:49 -05:00
Trowbridge
69346646bd change module to be the comment 2020-02-18 15:35:56 -05:00
Trowbridge
d3a4a45d53 change comment to be the tag 2020-02-18 14:47:46 -05:00
Trowbridge
7635380ccc ensure not to load null comments 2020-02-14 17:00:44 -05:00
Paul Trowbridge
db13f3d38c routes that make adjustments need to return comment info 2020-02-14 15:52:16 -05:00
Trowbridge
18558674c0 change key name to message 2020-02-14 14:41:51 -05:00
Trowbridge
a4d34ec83a add column names 2020-02-13 13:10:18 -05:00
Paul Trowbridge
21cb531e56 embed the module in the forecast pool instead of reading the json, cross join the newly inserted log file and id 2020-02-13 11:03:42 -05:00
pt
eddece49e1 start on scale_vd 2020-02-13 02:25:24 -05:00
Paul Trowbridge
d3332cc778 include promo code in base mix 2019-04-03 12:17:54 -04:00
fleetside72
8cb6b843ba recast scale_v to be based on qty and handle -0- qty 2019-04-03 01:42:10 -04:00
Paul Trowbridge
a88a611afd prevent div by zero 2019-03-21 16:50:51 -04:00
Trowbridge
b05d68f8ec dont sum up diext and discounts 2019-03-20 01:31:51 -04:00
Paul Trowbridge
932c95e83c dont use iterdet anymore since not in osm. iter = source + behavior 2019-03-14 10:47:29 -04:00
Paul Trowbridge
92657e72c3 update scale volume route to contain iteration info 2019-03-13 23:25:07 -04:00
Paul Trowbridge
41d7f4286a add routes to scale volume and also to scale price 2019-03-13 09:35:45 -04:00