Compare commits
No commits in common. "df1e2f0e58e57647c64b07060ce3f9584850d19a" and "ab72f947751f519f7d9d4b8d04727dce15c74670" have entirely different histories.
df1e2f0e58
...
ab72f94775
@ -94,8 +94,8 @@ SELECT
|
||||
,fb_qty units
|
||||
,fb_val_loc value_loc
|
||||
,fb_val_loc * r_rate value_usd
|
||||
,fb_cst_loc_cur cost_loc
|
||||
,fb_cst_loc_cur * c_rate cost_usd
|
||||
,fb_cst_loc cost_loc
|
||||
,fb_cst_loc * c_rate cost_usd
|
||||
,calc_status
|
||||
,flag
|
||||
,o.odate order_date
|
||||
|
@ -1,38 +0,0 @@
|
||||
BEGIN;
|
||||
|
||||
WITH
|
||||
plist AS (
|
||||
SELECT DISTINCT
|
||||
part
|
||||
,plnt
|
||||
FROM
|
||||
rlarp.osmf_dev
|
||||
)
|
||||
,clist AS (
|
||||
SELECT
|
||||
p.part
|
||||
,p.plnt
|
||||
,COALESCE(im.cgstcs,ip.chstcs, ir.y0stcs) stdcost
|
||||
FROM
|
||||
plist p
|
||||
LEFT OUTER JOIN lgdat.icstm im ON
|
||||
im.cgpart = p.part
|
||||
AND im.cgplnt = p.plnt
|
||||
LEFT OUTER JOIN lgdat.icstp ip ON
|
||||
ip.chpart = p.part
|
||||
AND ip.chplnt = p.plnt
|
||||
LEFT OUTER JOIN lgdat.icstr ir ON
|
||||
ir.y0part = p.part
|
||||
AND ir.y0plnt = p.plnt
|
||||
)
|
||||
UPDATE
|
||||
rlarp.osmf_dev o
|
||||
SET
|
||||
fb_cst_loc_cur = c.stdcost * o.fb_qty
|
||||
FROM
|
||||
clist c
|
||||
WHERE
|
||||
c.part = o.part
|
||||
AND c.plnt = o.plnt;
|
||||
|
||||
commit;
|
Loading…
Reference in New Issue
Block a user