couple minor issues

This commit is contained in:
pt 2020-02-15 02:55:33 -05:00
parent a83708a7ca
commit c602564cb7

View File

@ -193,6 +193,7 @@ SELECT
o.plnt
--promo in next step
--terms in next step
,c.bvterm terms
,o.bill_cust_descr
,o.ship_cust_descr
,o.dsm
@ -220,11 +221,14 @@ SELECT
,sum(coalesce(o.units,0)) units
,sum(coalesce(o.value_loc,0)) value_loc
,sum(coalesce(o.value_usd,0)) value_usd
,sum(coalesce(o.cost_loc,0)) cost_usd
,sum(coalesce(o.cost_loc,0)) cost_loc
,sum(coalesce(o.cost_usd,0)) cost_usd
,o.calc_status
,o.flag
FROM
rlarp.osm_pool o
LEFT OUTER JOIN lgdat.cust c ON
c.bvcust = rtrim(substr(o.bill_cust_descr,1,8))
WHERE
-----------------scenario----------------------------
where_clause
@ -239,6 +243,7 @@ SELECT
GROUP BY
--fspr in next step
o.plnt
,c.bvterm
--promo in next step
--terms in next step
,o.bill_cust_descr
@ -334,6 +339,7 @@ FROM
CROSS JOIN vscale s
CROSS JOIN mmixp m
CROSS JOIN closest
CROSS JOIN log
LEFT OUTER JOIN mseq ON
mseq.m = closest.m
LEFT OUTER JOIN gld od ON
@ -367,9 +373,9 @@ WHERE
)
,price AS (
SELECT
sd.fspr
b.fspr
,b.plnt
,m.promo
,b.promo
,b.terms
,b.bill_cust_descr
,b.ship_cust_descr
@ -419,6 +425,7 @@ sd.fspr
FROM
volume b
CROSS JOIN pscale p
CROSS JOIN log
WHERE
p.factor <> 0 or p.mod_price <> 0
)