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 $

Pertinent Price Rule Details

Calculator Evaluation Event: Before Calculate

Price Conditions

Quote . SBQQ__Type__c equals Value Amendment
Quote Line . NOT(ISBLANK(Original_Discount_Amt__c)) equals Formula True

Price Actions

Quote Line . Discount (Amt) = Original_Discount_Amt__c / (IF(SBQQ__DefaultSubscriptionTerm__c == 1, SBQQ__EffectiveSubscriptionTerm__c, 1) / SBQQ__ProrateMultiplier__c)

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();

5 thoughts on “CPQ – Amendment Discount Amount – Fix

  1. Thank you! Great idea! This has helped me resolve major issue.
    However, for quotes with subscription term not 12, do we need to change the price rule formula OR use effective subscription term in any case?

    subscOriginal_Discount_Amt__c / (IF(SBQQ__DefaultSubscriptionTerm__c==1,SBQQ__EffectiveSubscriptionTerm__c,1)/SBQQ__ProrateMultiplier__c)

  2. DP, this issue has been around for years and your approach certainly is an interesting one for addressing the amendment issue. There’s one other use case to consider on New Business and Renewals.
    Let’s say you have a 36 month deal worth $300,000, and on one line you insert a Discount Amount of $100,000 to give you one-third off.
    Then the client decides to only commit to 12 months. You change the Subscription Term to 12 months and the deal is $100,000 MINUS the $100,000 Discount Amount. So… FREE.
    My approach has always been to deactivate the AMOUNT option from the Discount Unit picklist. (You cannot delete, just deactivate.) That way, using Unit Price or Total Price targets, the discount will revert to Percent. This is not as exact as entering an amount as you will see rounding issues, but it resolves the rounding issue. Salesforce documentation will tell you can’t do that, but you can. It will cause issues with the Uplift Renewal Pricing Method, but that has it’s own issues so we recommend never using that out-of-the-box approach for Renewal Uplifts.
    But kudos to you on an interesting approach for the amendment portion of the issue.

    1. Hey David. Unless I’m missing your point, in general, when modifying the subscription term on an existing contract, best practice is to zero out the first contract and recreate it fresh with the new subscription term. At which point, you’d have the opportunity to adjust the discount on the quote for the new contract.

  3. In my prior comment, I meant to say: “…This is not as exact as entering an amount as you will see rounding issues, but it resolves the PRORATION issue.

Leave a Reply

Your email address will not be published.

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