CPQ – Amendment Discount Amount – Fix

The Issue
We recently discovered an issue with amending a Contract containing lines that had a Discount Amount on the original Quote. The issue is that, when you amend a line that has a Discount Amount from the original Quote, the whole discount value is put on that line from before. Which doesn’t make sense because when it is an amount, it should be a prorated amount based on the time left on the Contract. Because of this, when a customer cancels a Contract, the refund amount (negative amount) on the Quote would be different than what was actually owed.

Another Detail
A Quote Line that had a Discount % applied turns into a Subscription with the Discount % filled in. All good. When it renews, the renewal Quote Line has Discount AMOUNT $ filled in?! Not a Discount %. So as your discounted customers renew, this issue is propagated.

ProrateAmountDiscounts__c??
But but but, what about the ProrateAmountDiscounts__c special field as referenced here? This is a great solution but this will apply the proration to all types of Quotes. We only want it to apply to amendments.

The Solution
So I made a thing! It is two formula fields and a Price Rule. This thing will prorate the discount for any lines that had a Discount Amount on the original Quote.

Subscription – Original Discount $

Quote Line – Original Discount $

Price Rule – Quote Line – Amendment – Inject Calculated Discount $

And here is the production install link and this one for sandbox!

After you install, be sure to run the below script in the execute anonymous popup in the developer console. Click here to open the developer console in production and here to open it in sandbox.

MoreCPQPostInstall.AmendmentDiscountAmount_Fix_PostInstall();

D P

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.