From f2f4dcedae4bd5f120cf1151a679869e39766b15 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 19 Mar 2025 17:19:13 -0400 Subject: [PATCH] commit: 2025-03-19 17:19:13 --- build/build_forecast.sql | 5 +++++ build/dump_all.pg.slq | 5 +++++ build/dump_all.pg.sql | 0 inquirey/tots.sql | 4 +++- offline/snap_last_price.pg.sql | 0 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 build/dump_all.pg.slq create mode 100644 build/dump_all.pg.sql create mode 100644 offline/snap_last_price.pg.sql 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