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.
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.
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.
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
Quote . SBQQ__Type__c equals Value Amendment
Quote Line . NOT(ISBLANK(Original_Discount_Amt__c)) equals Formula True
Quote Line . Discount (Amt) = Original_Discount_Amt__c / (IF(SBQQ__DefaultSubscriptionTerm__c == 1, SBQQ__EffectiveSubscriptionTerm__c, 1) / SBQQ__ProrateMultiplier__c)