vault backup: 2023-11-10 11:25:21
This commit is contained in:
parent
fcc1ade2cf
commit
12b963b22f
@ -135,8 +135,8 @@ export function apply_guidance(doc: any) {
|
||||
anchorSource = doc.hist.cust.early_season + ' Similar (' + doc.hist.cust.ds + ') Customer Price ' + earlyPrice + ' x ' + doc.bridgePremium + ' = ' + anchorPrice;
|
||||
}
|
||||
} else {
|
||||
anchorPrice = doc.targetPrice;
|
||||
anchorSource = 'Target Price';
|
||||
anchorPrice = targetPrice;
|
||||
anchorSource = `Target Price ${targetPrice}`;
|
||||
}
|
||||
|
||||
const inflation = Math.max(...Object.keys(doc.iidx).map(Number));
|
||||
@ -151,9 +151,12 @@ export function apply_guidance(doc: any) {
|
||||
doc.finalPrice = calcPrice;
|
||||
finalReason = `${anchorSource} x ${inflationFactor} = ${calcPrice}`;
|
||||
}
|
||||
doc.anchorPrice = anchorPrice;
|
||||
doc.anchorSource = anchorSource;
|
||||
doc.inflationFactor = inflationFactor;
|
||||
doc.finalReason = finalReason;
|
||||
doc.bridgePremium = bridgePremium;
|
||||
doc.targetPrice = targetPrice;
|
||||
|
||||
return doc;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ DECLARE
|
||||
_mold text;
|
||||
_stlc text;
|
||||
_cust text;
|
||||
_curr text;
|
||||
_v1ds text;
|
||||
_v0ds text;
|
||||
_v1tp jsonb;
|
||||
@ -58,7 +59,8 @@ BEGIN
|
||||
----------------customer------------------------------------
|
||||
|
||||
SELECT dba INTO _cust FROM rlarp.cust WHERE code = CASE WHEN _chan = 'DRP' THEN _ship ELSE _bill END ;
|
||||
_rslt = _rslt||jsonb_build_object('cust',_cust);
|
||||
SELECT currency INTO _curr FROM rlarp.cust WHERE code = _bill;
|
||||
_rslt = _rslt||jsonb_build_object('cust',_cust,'curr',_curr);
|
||||
--RAISE NOTICE 'cust %', _cust;
|
||||
|
||||
----------------price history-------------------------------
|
||||
|
@ -14,6 +14,7 @@ DECLARE
|
||||
_mold text;
|
||||
_item text;
|
||||
_cust text;
|
||||
_curr text;
|
||||
_v1ds text;
|
||||
_v0ds text;
|
||||
_v1tp jsonb;
|
||||
@ -74,7 +75,8 @@ BEGIN
|
||||
----------------customer------------------------------------
|
||||
|
||||
SELECT dba INTO _cust FROM rlarp.cust WHERE code = CASE WHEN _chan = 'DRP' THEN _ship ELSE _bill END ;
|
||||
_rslt = _rslt||jsonb_build_object('cust',_cust);
|
||||
SELECT currency INTO _curr FROM rlarp.cust WHERE code = _bill;
|
||||
_rslt = _rslt||jsonb_build_object('cust',_cust,'curr',_curr);
|
||||
RAISE NOTICE 'cust %', _cust;
|
||||
|
||||
----------------price history-------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user