vault backup: 2023-11-07 01:34:18

This commit is contained in:
Paul Trowbridge 2023-11-07 01:34:18 -05:00
parent 8119255e46
commit 193b489e62
2 changed files with 19 additions and 2 deletions

2
api.ts
View File

@ -175,7 +175,7 @@ router.get('/code_price/:billcode/:shipcode/:partcode/:qty', async (ctx) => {
//console.log(customer)
const result = await client.queryObject({args: [billcode, shipcode, partcode, qty], text: query} );
const procd = apply_guidance(result.rows[0]["doc"])
ctx.response.body = procd
ctx.response.body = procd;
});
app.use(router.routes());

View File

@ -44,7 +44,7 @@ BEGIN
i.item = _item;
--RAISE NOTICE 'mold %', _mold;
--RAISE NOTICE 'v1ds %', _v1ds;
_rslt := jsonb_build_object('mold',_mold,'v1ds',_v1ds,'v0ds',_v0ds)||_iidx;
_rslt := jsonb_build_object('mold',_mold,'v1ds',_v1ds,'v0ds',_v0ds,'stlc',_stlc)||_iidx;
----------------channel-------------------------------------
@ -62,6 +62,23 @@ BEGIN
SELECT _rslt||jsonb_build_object('hist',rlarp.gethist(_mold, _cust)) INTO _rslt ;
--RAISE NOTICE '%', _rslt;
----------------target pricing------------------------------
SELECT
jsonb_build_object(
'v0tp',
target_price,
'stdv',
stdev_price
)
INTO
_targ
FROM
pricequote.market_setavgprice
WHERE
mold = _stlc
AND season = _seas
AND data_segment = _v0ds
AND region = 'ALL';
----------------target pricing------------------------------
SELECT
jsonb_build_object(