Some of the current criteria we have for autorenewal are:
Are any of the memberships that are attached to the payment plan has an end date that is less or equal today date (with days to renew in advance setting in mind).
Or if there are no memberships attached to the payment plan, then check if there are any active autorenewal subscription line items attached to the payment plan (though to be clear we are not officially supporting payment plans without memberships yet).
And if any of these conditions apply, then we proceed with the autorenewal.
Here I change this to use the payment plan "next scheduled contribution date" as a condition for auto-renewal, so if this field value is less or equal today date (with days to renew in advance setting in mind) then we renew the payment plan, otherwise we don't.
And as part of this, we now set the new first installment receive date to equal the "next scheduled contribution date" instead of using the new membership "start date", where the rest of the installments follow the first installment date same as before.
This simplify the autorenewal by removing the dependency on the related membership dates, and allows for better flexibility in controlling when the renewal should happen and controlling the new installment dates.
Hence that this does not mean we removed other autorenewal conditions, such as that you still need to have active renewal subscription line items for the renewal to happen, and that the payment plan should not be cancelled ..etc
As part of this PR, I also did the following:
1- Created an upgrader to update the "next scheduled contribution date" for all existing offline payment plans to equal the minimum membership end date attached to it, which should ensure that the renewals should happen next time at their correct dates.
2- I changed the autorenewal job to use the "recurring contribution status" option group instead of "contribution status" option group, it is just happened that the Values for the option values in each option group are almost similar such as for the "Cancelled" status were both equal 3. Also the refunded status does not exist for recurring contributions, so I removed it from the query that get the recurring contributions to renew and just kept the part where it check for non cancelled recurring contributions.
Overview
Some of the current criteria we have for autorenewal are:
days to renew in advance
setting in mind).And if any of these conditions apply, then we proceed with the autorenewal.
Here I change this to use the payment plan "next scheduled contribution date" as a condition for auto-renewal, so if this field value is less or equal today date (with
days to renew in advance
setting in mind) then we renew the payment plan, otherwise we don't.And as part of this, we now set the new first installment receive date to equal the "next scheduled contribution date" instead of using the new membership "start date", where the rest of the installments follow the first installment date same as before.
This simplify the autorenewal by removing the dependency on the related membership dates, and allows for better flexibility in controlling when the renewal should happen and controlling the new installment dates.
Hence that this does not mean we removed other autorenewal conditions, such as that you still need to have active renewal subscription line items for the renewal to happen, and that the payment plan should not be cancelled ..etc
As part of this PR, I also did the following:
1- Created an upgrader to update the "next scheduled contribution date" for all existing offline payment plans to equal the minimum membership end date attached to it, which should ensure that the renewals should happen next time at their correct dates. 2- I changed the autorenewal job to use the "recurring contribution status" option group instead of "contribution status" option group, it is just happened that the Values for the option values in each option group are almost similar such as for the "Cancelled" status were both equal 3. Also the refunded status does not exist for recurring contributions, so I removed it from the query that get the recurring contributions to renew and just kept the part where it check for non cancelled recurring contributions.