From 4f903cfd7f41cdb551cd0fc35a3b448d3ee6bc40 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 1 Aug 2025 08:44:38 -0400 Subject: [PATCH 1/2] link in history based on part group --- new_targets/scripts/matrix_guidance.pg.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new_targets/scripts/matrix_guidance.pg.sql b/new_targets/scripts/matrix_guidance.pg.sql index 176bbfd..8f999bf 100644 --- a/new_targets/scripts/matrix_guidance.pg.sql +++ b/new_targets/scripts/matrix_guidance.pg.sql @@ -179,7 +179,7 @@ BEGIN FROM pricequote.lastprice lp WHERE lp.customer = q.cust - AND lp.partgroup = SUBSTRING(q.part, 1, 8); + AND lp.partgroup = q.partgroup; ----------------------------------------------------------------------- -- Step 5: Resolve best list price and insert it with list code From 5cf94da8151d337666716c51ab160eb8796274d5 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 1 Aug 2025 10:03:36 -0400 Subject: [PATCH 2/2] switch to current standard cost --- new_targets/procs/get_option_costs_priceg.pg.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new_targets/procs/get_option_costs_priceg.pg.sql b/new_targets/procs/get_option_costs_priceg.pg.sql index ddef636..4ddb5db 100644 --- a/new_targets/procs/get_option_costs_priceg.pg.sql +++ b/new_targets/procs/get_option_costs_priceg.pg.sql @@ -77,7 +77,7 @@ SELECT ,sel.avgfc ,sel.avgwt ,t.price - ,round(CASE WHEN coalesce(t.price,0) <> 0 THEN (t.price-COALESCE(sel.avgfc,0))/t.price ELSE 0 END,3) futmarg + ,round(CASE WHEN coalesce(t.price,0) <> 0 THEN (t.price-COALESCE(sel.avgsc,0))/t.price ELSE 0 END,3) curmarg FROM sel LEFT OUTER JOIN pricequote.target_prices t ON