compucorp / uk.co.compucorp.membershipextras

Membership Extras for CiviCRM
Other
5 stars 8 forks source link

MAE-769: Use membershipextras custom logic for adding date to calculate next instalment dates for an annual recurring contribution #437

Closed olayiwola-compucorp closed 2 years ago

olayiwola-compucorp commented 2 years ago

Overview

Before now, the PHP builtin date->add method is used to get the next instalment dates for an annual recurring contribution, in this PR we change this and use the custom logic in getSameDayNextMonth. This will enable the proper handling of leap dates.

Also in a previous work we prevented the next scheduled contribution date day from exceeding 28, in this PR we limit it such that this will not affect the next scheduled contribution date day of annual recurring contribution whose month is not February

Before

If the last contribution date is 02/29 - the next scheduled date is 03-01 MAE-770

After

If the last contribution date is 02/29 - the next scheduled date is 02-28 aaaasas

Before

The next scheduled contribution date of annual recurring contribution can't exceed 28 for all months aaa

After

The next scheduled contribution date of annual recurring contribution can exceed 28 so far it is not in the month of February aaaasas