top of page

Contracted price

I want to calcul the contracted price, how to do it?

In custom script

Custom field




Custom script


export function   onBeforePriceRules(_quoteModel, quoteLineModels) {
return new Promise((resolve, reject) => {
try {
updateLineItemPrices(quoteLineModels);
resolve(); // Resolves the promise upon   successful completion
} catch (error) {
reject(error); // Rejects the promise if an   error occurs
}
});
}

function updateLineItemPrices(quoteLineModels)   {
quoteLineModels.forEach(line => {
if (line.record.SBQQ__ContractedPrice__c !=   null && !line.record.ContractedPriceInsert__c) {
line.record['SBQQ__ListPrice__c'] =   line.record.ContractedListPrice__c;
line.record.ContractedPriceInsert__c = true;
}

if (line.record.SBQQ__ContractedPrice__c !=   null && line.record.ContractedPriceInsert__c) {
line.record['SBQQ__SpecialPrice__c'] =   line.record['SBQQ__ListPrice__c'];
line.record['SBQQ__SpecialPriceType__c'] =   'Custom';
}
});
}

Things you need to think about

In the object contracted price, you can have a discount for this product, you need to modify the custom script according to this use case too.

The result

Using flow

you can also give a contracted price according to a PB

Assign price book to a opportunity according a catalogue from account

Custom field

In account



In price book



Flow








Result


Using Price rule

Price rule



Price condition






Price action



Upgrade time

This usecase is not optimal, the best is to separate into two price rule or do a custom script


Result


0 views0 comments

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page