direct not hooking up due to change to using just the name
This commit is contained in:
parent
ffee472954
commit
ebc169e34a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user