From ebc169e34a9ca9e28bfc29ac61dc9456dc97b903 Mon Sep 17 00:00:00 2001 From: Trowbridge Date: Tue, 25 Feb 2020 16:57:08 -0500 Subject: [PATCH] direct not hooking up due to change to using just the name --- route_sql/new_basket.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/route_sql/new_basket.sql b/route_sql/new_basket.sql index 9aea189..807057b 100644 --- a/route_sql/new_basket.sql +++ b/route_sql/new_basket.sql @@ -72,6 +72,7 @@ target AS (select $$replace_request$$::json def) ,REPC AS ( SELECT LTRIM(RTRIM(C.A9)) RCODE + ,c.a30 rname ,LTRIM(RTRIM(C.A9)) || ' - ' || C.A30 REPP ,COALESCE(Q.DIR,'Other') DIRECTOR FROM @@ -271,9 +272,9 @@ SELECT ,bc.bvterm terms ,b.bill_cust_descr ,b.ship_cust_descr - ,(SELECT rcode FROM repc WHERE repp = log.doc->'scenario'->>'quota_rep_descr') dsm + ,(SELECT max(rcode) FROM repc WHERE rname = log.doc->'scenario'->>'quota_rep_descr') dsm ,log.doc->'scenario'->>'quota_rep_descr' quota_rep_descr - ,(SELECT director FROM repc WHERE repp = log.doc->'scenario'->>'quota_rep_descr') director + ,(SELECT max(director) FROM repc WHERE rname = log.doc->'scenario'->>'quota_rep_descr') director ,CASE bc.BVADR6 WHEN '' THEN bc.BVNAME ELSE bc.BVADR6 END billto_group ,CASE sc.BVADR6 WHEN '' THEN sc.BVNAME ELSE bc.BVADR6 END shipto_group ,CASE SUBSTRING(bc.bvclas,2,3)