vault backup: 2023-11-07 00:48:22
This commit is contained in:
parent
1f308befbb
commit
1b54c2d370
@ -19,6 +19,7 @@ DECLARE
|
||||
_rslt jsonb;
|
||||
_targ jsonb;
|
||||
_list jsonb;
|
||||
_iidx jsonb;
|
||||
|
||||
BEGIN
|
||||
--_item := 'AMK06000G18B054';
|
||||
@ -31,9 +32,9 @@ BEGIN
|
||||
----------------base product--------------------------------
|
||||
|
||||
SELECT
|
||||
m.part_group, i.v1ds,i.v0ds
|
||||
m.part_group, i.v1ds,i.v0ds,jsonb_build_object('assc',i.assc,'majg',i.majg::int,'coltier',i.coltier) idxk
|
||||
INTO
|
||||
_mold,_v1ds ,_v0ds
|
||||
_mold,_v1ds ,_v0ds, _iidx
|
||||
FROM
|
||||
"CMS.CUSLG".itemmv i
|
||||
INNER JOIN rlarp.molds m ON
|
||||
@ -42,7 +43,7 @@ BEGIN
|
||||
i.item = _item;
|
||||
--RAISE NOTICE 'mold %', _mold;
|
||||
--RAISE NOTICE 'v1ds %', _v1ds;
|
||||
_rslt := jsonb_build_object('mold',_mold,'v1ds',_v1ds,'v0ds',_v0ds);
|
||||
_rslt := jsonb_build_object('mold',_mold,'v1ds',_v1ds,'v0ds',_v0ds)||_iidx;
|
||||
|
||||
----------------channel-------------------------------------
|
||||
|
||||
@ -80,6 +81,29 @@ BEGIN
|
||||
--RAISE NOTICE 'target: %', jsonb_pretty(_targ);
|
||||
_rslt := _rslt||COALESCE(_targ,'{}'::jsonb);
|
||||
|
||||
----------------inflation index-----------------------------
|
||||
SELECT
|
||||
jsonb_build_object(
|
||||
'iidx'
|
||||
,jsonb_build_object(
|
||||
priority
|
||||
,min(factor)
|
||||
)
|
||||
)
|
||||
INTO
|
||||
_iidx
|
||||
FROM
|
||||
rlarp.costindex
|
||||
WHERE
|
||||
timeframe @> current_date
|
||||
AND (
|
||||
attr @> _iidx
|
||||
OR attr @> jsonb_build_object('stlc',_mold)
|
||||
)
|
||||
GROUP BY
|
||||
priority;
|
||||
--RAISE NOTICE 'target: %', jsonb_pretty(_targ);
|
||||
_rslt := _rslt||COALESCE(_iidx,'{}'::jsonb);
|
||||
----------------list ppricing-------------------------------
|
||||
SELECT coalesce(rlarp.get_list(_bill, _ship, _item, _qty),'{}'::jsonb) INTO _list;
|
||||
_rslt := _rslt||_list;
|
||||
|
Loading…
Reference in New Issue
Block a user