diff --git a/build/build_forecast.sql b/build/build_forecast.sql index 4690e82..aeaa43c 100644 --- a/build/build_forecast.sql +++ b/build/build_forecast.sql @@ -716,3 +716,8 @@ UPDATE rlarp.osmf SET iter = 'short ship' WHERE calc_status = 'CLOSED' AND flag ---identify goofy ship dates: causes disconnect with sales when splicing in a forecast that has this problem------------------- UPDATE rlarp.osmf SET iter = 'bad date' WHERE sdate < odate; + +--flag budget orders that are planned to book before the budget +UPDATE rlarp.osmf SET iter = 'py carryover' WHERE iter = 'copy' AND odate <= '2025-06-01'; + +--flag past due orders that are dropping out in shipments on current date diff --git a/build/dump_all.pg.slq b/build/dump_all.pg.slq new file mode 100644 index 0000000..fef1925 --- /dev/null +++ b/build/dump_all.pg.slq @@ -0,0 +1,5 @@ +SELECT + o.* + ,o.lbs * o.fb_qty ext_lbs +FROM + rlarp.osmf o diff --git a/build/dump_all.pg.sql b/build/dump_all.pg.sql new file mode 100644 index 0000000..e69de29 diff --git a/inquirey/tots.sql b/inquirey/tots.sql index db821f0..064e541 100644 --- a/inquirey/tots.sql +++ b/inquirey/tots.sql @@ -5,6 +5,7 @@ SELECT to_char(CASE WHEN extract(month FROM o.sdate) >= 6 THEN -5 ELSE 7 END + extract(month FROM o.sdate),'FM00')||' - '||to_char(o.sdate,'TMMon') ship_month, version, iter, + calc_status, sum(fb_val_loc * r_rate) value_loc FROM rlarp.osmf o @@ -17,7 +18,8 @@ GROUP BY sseas, to_char(CASE WHEN extract(month FROM o.sdate) >= 6 THEN -5 ELSE 7 END + extract(month FROM o.sdate),'FM00')||' - '||to_char(o.sdate,'TMMon'), version, - iter + iter, + calc_status ORDER BY oseas asc, order_month asc diff --git a/offline/snap_last_price.pg.sql b/offline/snap_last_price.pg.sql new file mode 100644 index 0000000..e69de29