vault backup: 2023-11-10 10:09:38
This commit is contained in:
parent
1250c671e7
commit
8a746aa42c
@ -122,16 +122,13 @@ export function apply_guidance(doc: any) {
|
||||
// Determine the anchor price and source
|
||||
if (doc.hist.cust?.early_price !== undefined ) {
|
||||
if (doc.hist.cust.relevance !== 'customer exact') {
|
||||
// translate alternate product history to current product quoted
|
||||
doc.anchorPrice = Number((doc.hist.cust.early_price * doc.bridgePremium).toFixed(5));
|
||||
if (doc.targetPrice < doc.anchorPrice) {
|
||||
doc.anchorPrice = doc.targetPrice;
|
||||
doc.anchorSource = 'Target Price'
|
||||
} else {
|
||||
doc.anchorSource = doc.hist.cust.early_season + ' Similar (' + doc.hist.cust.ds + ') Customer Price ' + doc.hist.cust.early_price + ' x ' + doc.bridgePremium + ' = ' + doc.anchorPrice;
|
||||
if (doc.targetPrice < doc.anchorPrice) {
|
||||
doc.anchorSource = 'Target Price';
|
||||
doc.anchorPrice = doc.targetPrice;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
doc.anchorPrice = doc.hist.cust.early_price;
|
||||
|
5
sql/db_apply.pg.sql
Normal file
5
sql/db_apply.pg.sql
Normal file
@ -0,0 +1,5 @@
|
||||
SELECT
|
||||
rlarp.get_guidance(lq.billto, lq.shipto, lq.part, lq.units_each, 2024)
|
||||
FROM
|
||||
pricequote.live_quotes lq
|
||||
LIMIT 100
|
Loading…
Reference in New Issue
Block a user