iATSPayments / com.iatspayments.civicrm

CiviCRM Extension supporting iATS Payments services
Other
14 stars 38 forks source link

End of Month Recurring Contributions #241

Open cmmadmin opened 6 years ago

cmmadmin commented 6 years ago

We have noticed that if a monthly recurring contribution is created on the last day of the month, then it will get pushed to the next month if the following month has less days than the previous month.

For example,

  1. Recurring contribution is created on March 31.
  2. First contribution is process on March 31 as expected.
  3. Second contribution is processed on May 1 (since April 31 does not exist).
  4. Third contribution is processed on June 1.
  5. Etc...

This is confusing for our users that are tracking their monthly donations. In this example, they see a contribution in March, May and June but it appears that a donation was missed in April. It's even worse in January since February has 28 days (most years!)

Our solution has been to move all recurring contributions with "Next Scheduled Contribution" > 28 to the 28th of that month. But, this is a tedious process that we need to remember to do each month.

Is there a better solution for this?

adixon commented 6 years ago

Yes, that is the expected behaviour. The code tends to err on the side of not annoying donors by preventing contributions more often than they have signed up for. To my mind, if my first donation is on the 31 and then next month only has 28 days, it's not unreasonable to push the next donation to the first of the following month. As another example, my mortgage comes out rather randomly, especially at the end of a short month.

You could prevent some confusion by forcing recurring contributions to limit to days 1-28, at the cost of confusion on the first donation if it's on the 29-31.

Other than that, it's a fairly universal problem. If you have a solution as to how it might work better, then do tell!

cmmadmin commented 6 years ago

Thanks for the response Alan. I would vote that a change be made to the code to force recurring contributions to limit to days 1-28 (E.g., if "Next Scheduled Contribution" > 28 then set it to 28th of that month). It seems pushing backwards is less confusing than pushing forward, especially if you are using reports or reporting software that show donations in a monthly summary view as we are.

adixon commented 6 years ago

Okay, that sounds like it could reasonably be included as a configuration option, i.e. if someone contributes on the 29 or 30 or 31, then their recurring contribution date goes to the 28th.

cmmadmin commented 6 years ago

Yes! Big thumbs up for that solution!

KarinG commented 6 years ago

@cmmadmin - are you on Drupal by any chance? CiviCRM Entity in combination with Views Bulk operations are nice tools to let you set next scheduled contribution dates in bulk (have a view that filters for >28 - and then bulk update those to 28).

I wrote this up in a SE post: https://civicrm.stackexchange.com/questions/18326/how-can-i-bulk-update-a-collection-of-recurring-contributions-to-set-the-next-sc

KarinG commented 6 years ago

I received the following info from iATS Payments' staff about how they handle recurring series/end of month dates in their native platform:

Will work on adding that logic into the iATS Extension; Does that sound about right @cmmadmin ?

cmmadmin commented 6 years ago

That looks good. Thank you Karin!

adixon commented 6 years ago

That's going to be tricky - take the one you process on Feb 28, typically the next contribution date is based on the current one, but that logic will require going back to the previous months and making guesses, which sounds prone to error. I think we probably want it to use the current logic or the last day of the next month, whichever is less. So you'd end up with Jan 31, Feb 28, Mar 28, Apr 28, etc.

cmmadmin commented 6 years ago

Having it roll back to the last day of the next month as Alan described would work for us as well.