SparkDevNetwork / Rock

An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
http://www.rockrms.com
574 stars 346 forks source link

Consistently Erratic Giving Overview #5187

Closed JRichmond27 closed 1 year ago

JRichmond27 commented 2 years ago

Prerequisites

A Picture Is worth a Thousand Words

image

Description

I'm not sure if this is an actual bug or just something that just needs to be clarified. We recently updated our dev instance to v13 and I'm noticing some strange information on the new Giving Overview block.

We have two main accounts that our congregation can give to, a main general church fund and a building campaign fund. Anyone who has automatic giving set up for both funds ends up with a Giving Jouney of "Consistent", but a Giving Frequency of "Erratic".

I did some digging in the source code, and it appears to be because of how the Typical Frequency is being calculated in Rock/Jobs/GivingAutomation.cs. For the specific example in the screenshot, that person is giving to both accounts on the 6th of every month, so there's approximately 30 days in between gifts. The problem seems to be that the frequency calculations are treating them as separate gifts to each account, which means there are 30 days between half of the gifts and only about 3 seconds between the other half. As a result, the calculations come up with a mean frequency of 15 days and a standard deviation of 14.8 days, which definitely sounds erratic on paper. In reality, I would say that person is giving very consistently.

Is this working as intended? Or is this an edge case that's somehow triggered by using Pushpay as our giving platform?

I'd like to suggest that gifts on the same day, or at least within a certain threshold should be treated as a single gift, at least when it comes to calculating frequency and maybe even typical gift.

Steps to Reproduce

  1. Set up two or more tax deductible financial accounts
  2. Have a person give regularly to both accounts on the same day every month for an extended period of time
  3. Make sure the Giving Automation system job has run
  4. Look at the person's Giving Overview and notice that they are labeled as "Erratic"

Expected behavior:

I would expect the person's typical frequency to be about 30 days with a standard deviation of close to 0 days, and I'd expect the frequency label to be "Monthly"

Actual behavior:

The person's typical frequency is 15 days with a standard deviation of 14.8 days, and the frequency label is "Erratic"

Versions

JRichmond27 commented 1 year ago

Thank you!

JRichmond27 commented 11 months ago

@MrUpsideDown, is there anything we need to do on our end to get trigger the new behavior that considers same-day gifts as a single gift?

We updated from 14.2 to 15.2 last week, it it appears that same-day gifts are still being considered as separate gifts. A person with two scheduled gifts that occur on the same day every month is still being labeled as "Erratic".

MrUpsideDown commented 10 months ago

@JRichmond27 - nothing you need to do, just something I need to fix! Apologies for the confusion, this will take effect in 15.3 which is scheduled for release very shortly. I've updated the Fixed label to reflect this change.

JRichmond27 commented 10 months ago

No problem... Thanks for letting me know!