Closed olayiwola-compucorp closed 3 years ago
Just to add some details here, if subscription line item for single installment (annual) payment plan has an end date, then it means that it is for a previous term, if not then it means it is for the current term, we do that because in annual payment plan we don't create new payment plan after renewal (as it is the case for monthly or quarterly payment plans), but rather keep using the existing one, so the end date on the subscription line item help to identify which subscription line items are current and which belong to an old term.
Merging this PR after passing QA
Overview
This PR ensures that Recurring contribution amount is correct after adding a line item in manage installments view of annual payment plan and that has auto renewal
Before
After
Technical Details
When calculating new total amount for recurring contribution, ensure that only amount from line items with end_dates are included (Given that the payment has one or no installment). same condition is applied to every other part of the code where total recurring contribution amount is calculated.