Proration logic and Fixed or percentage Coupon - PC 1.0
Coupons are not applied for an extended period
The next billing amount does not show the coupon applied - PC 1.0
Invoice Coupons get applied on the total invoice irrespective of the coupon type. Consider a subscription with a $100 plan and coupon of discount type 10% of the invoice amount. This means a 10% discount will be calculated on the total invoice amount.
For our calculation, let’s discard the coupon initially and finally apply the coupon.
When subscription is created, an invoice of $100 is generated.
I immediately change the subscription and increase the plan items to 2. Now a new invoice of another $100 is generated.
Total invoice amount is $200. The coupon of 10% now applied means discount is $20. So the total invoice amount including coupon is $180.
Now applying the coupon during invoice generation,
10% coupon when applied on the first invoice gives $90
10% coupon on the second invoice(by increasing the plan item to 2) gives another $90 bringing the total invoiced amount to $180 which is the same as applying the coupon on the total invoiced amount as calculated in the approach 1.
So percentage coupon gets applied on each invoice in the billing period.
NOTE : In the case of invoice percentage coupon, as the total invoiced amount during a billing period increases, the amount deducted by applying the percentage coupon also increases and this increase is achieved by applying the percentage coupon on each invoice i.e., if the total invoiced amount is $500, 10% coupon deduction is $50 and if the total invoiced amount is $1000, 10% coupon deduction is $100.
We have a subscription with a $100 plan and $10 fixed price on invoice amount coupon. The invoice amount excluding the coupon is $100. Let’s increase the billing period by 15 days and prorate. Now a new invoice of $50 is generated. So the total invoiced amount is $150. $10 fixed amount coupon is applied to this $150 and final invoiced amount comes to $140. This is the correct way of applying fixed amount on invoice coupon type.
Video recording : https://watch.screencastify.com/v/8FRigm2dvdHYNVLyG1eo
In the subscription mentioned in the video, the $299 coupon is applied on the invoice generated on Nov 5th. When the billing period is increased from Dec 5th to Jan 1st, the subscription is in the same billing period and a new invoice is generated but $299 coupon will not be applied to this invoice also since it has already been applied on the invoice generated on Nov 5. As mentioned above, coupon is applied to the total invoice amount for the billing period rather than each invoice. Since $299 coupon has been applied on Nov 5 invoice, it is not applied again.
In the video, when the billing period was reduced from Dec 5th to Dec 1st and prorated, the app does not generate a new invoice but rather it generates a credit note and hence coupon is included in that calculation
NOTE : In the case of fixed amount coupon, the coupon amount deducted does not increase with an increase in total invoiced amount but rather it is a fixed deduction i.e., if the total invoiced amount is is $500, fixed amount coupon deduction is $50 and if the total invoiced amount is $1000, fixed amount coupon deduction is still $50.
Now once this value has been deducted from one/two/more invoices, further new invoices in the billing period will not consider the fixed amount coupon. In this Jira ticket, fixed amount coupon has been completely deducted in the first invoice itself. So when the next invoice is generated by increasing the billing period, coupon is not included.
Fixed amount coupons are applied once in the billing cycle(chargebee docs). When a coupon of discount type “fixed amount” is chosen to apply on “invoice amount”, it means the coupon is applied on the “total invoice amount” rather than each invoice generated within the same billing period i.e., coupon is applied for each billing period rather than each invoice.
To clarify, We can generate multiple invoices for a specific billing period by changing the plan amount, plan quantity, billing period and such. Fixed amount on invoice coupon will not be applied for each invoice generated but rather it should be applied on the total invoice amount for the billing period.
For fixed amount coupons, if the coupon fixed amount is already deducted in the first invoice, then there is nothing to deduct during the second invoice and thus coupon is not included in the scenario mentioned in the description.
It is also possible that fixed amount configured in the coupon is not completely deducted in the first invoice i.e., invoice amount < coupon amount. In such cases when the next invoice is generated in that billing period, the remaining coupon amount will be applied.