bug: ship to group join was predicated on bill_to customer

This commit is contained in:
Paul Trowbridge 2019-03-27 09:14:50 -05:00
parent ec89d14c91
commit 62473aee92
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
SELECT
iterdef->>'user' "user",
iterdef->>'stamp' "stamp",
(iterdef->>'stamp')::timestamptz "stamp",
iterdef->>'mesasage' "comment",
round(SUM(fb_val_loc * r_rate)::numeric,2) sales,
jsonb_pretty(iterdef) def
@ -13,3 +13,5 @@ GROUP BY
iterdef->>'stamp',
iterdef->>'message',
iterdef
ORDER BY
"stamp" DESC

View File

@ -581,7 +581,7 @@ FROM
LEFT OUTER JOIN LGDAT.CUST BC ON
BC.BVCUST = b.BILL_CUST
LEFT OUTER JOIN LGDAT.CUST SC ON
SC.BVCUST = b.BILL_CUST
SC.BVCUST = b.SHIP_CUST
LEFT OUTER JOIN RLARP.FFCHNL c ON
c.BILL = bc.bvclas
AND c.SHIP = sc.bvclas