Compare commits
No commits in common. "3e127042410dd5310c1122e85796e26243d2fd3f" and "e040132bce2d9761f9d636fc3e3c0feffd3c4a07" have entirely different histories.
3e12704241
...
e040132bce
@ -153,7 +153,7 @@ FROM
|
|||||||
--the item master could have multiple since its defined per plant but will take the first item for now
|
--the item master could have multiple since its defined per plant but will take the first item for now
|
||||||
AND up.pckg ? (i.uomp->>0)
|
AND up.pckg ? (i.uomp->>0)
|
||||||
AND COALESCE(i.BRANDING,'') = up.branding
|
AND COALESCE(i.BRANDING,'') = up.branding
|
||||||
AND COALESCE(i.ACCS_PS,'') = up.ACCS
|
AND COALESCE(i.ACCS,'') = up.ACCS
|
||||||
AND COALESCE(i.SUFFIX,'') = up.suffix
|
AND COALESCE(i.SUFFIX,'') = up.suffix
|
||||||
AND APLNT <> 'I'
|
AND APLNT <> 'I'
|
||||||
)
|
)
|
||||||
@ -216,14 +216,14 @@ WHERE
|
|||||||
,string_agg(DISTINCT coltier ,', ') FILTER (WHERE clist IS NOT NULL) coltier
|
,string_agg(DISTINCT coltier ,', ') FILTER (WHERE clist IS NOT NULL) coltier
|
||||||
,string_agg(DISTINCT branding,', ') branding
|
,string_agg(DISTINCT branding,', ') branding
|
||||||
-------replace blank with 'none'--------------
|
-------replace blank with 'none'--------------
|
||||||
,regexp_replace(string_agg(DISTINCT accs ,','),'^,','','g') accs
|
,regexp_replace(string_agg(DISTINCT accs ,', '),'^,','none,','g') accs
|
||||||
,regexp_replace(string_agg(DISTINCT suffix ,','),'^,','','g') suffix
|
,string_agg(DISTINCT suffix ,', ') suffix
|
||||||
,pckg
|
,pckg
|
||||||
,col
|
,col
|
||||||
,vol_uom
|
,vol_uom
|
||||||
,voL_qty
|
,voL_qty
|
||||||
,max(nm) nm
|
,nm
|
||||||
,max(dm) dm
|
,dm
|
||||||
,price
|
,price
|
||||||
-----convert json array to a plain text representation as well as remove nulls------
|
-----convert json array to a plain text representation as well as remove nulls------
|
||||||
,regexp_replace(jsonb_arr_aggcd(clist)::text,'["\[\]]|null, ','','g') clist
|
,regexp_replace(jsonb_arr_aggcd(clist)::text,'["\[\]]|null, ','','g') clist
|
||||||
@ -236,11 +236,13 @@ WHERE
|
|||||||
,col
|
,col
|
||||||
,vol_uom
|
,vol_uom
|
||||||
,vol_qty
|
,vol_qty
|
||||||
|
,nm
|
||||||
|
,dm
|
||||||
,price
|
,price
|
||||||
)
|
)
|
||||||
,seq_levels AS (
|
,seq_levels AS (
|
||||||
SELECT
|
SELECT
|
||||||
plist||'.'||stlc||'.'||pckg||'.'||col||'.'||to_char(row_number() OVER (PARTITION BY plist, stlc, pckg, col ORDER BY price ASC),'FM00') lookup
|
plist||'.'||stlc||'.'||pckg||'.'||col||'.'||to_char(row_number() OVER (PARTITION BY plist, stlc, col ORDER BY price ASC),'FM00') lookup
|
||||||
,plist
|
,plist
|
||||||
,stlc
|
,stlc
|
||||||
,coltier
|
,coltier
|
||||||
|
Loading…
Reference in New Issue
Block a user