Rock
Rock copied to clipboard
Consistently Erratic Giving Overview
Prerequisites
- [ ] Put an X between the brackets on this line if you have done all of the following:
- Did you perform a search at https://github.com/issues?q=is%3Aissue+user%3ASparkDevNetwork+-repo%3ARock to see if your bug or enhancement is already reported?
- Can you reproduce the problem on a fresh install or the demo site?
- Did you include your Rock version number and client culture setting?
A Picture Is worth a Thousand Words
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
- Set up two or more tax deductible financial accounts
- Have a person give regularly to both accounts on the same day every month for an extended period of time
- Make sure the Giving Automation system job has run
- 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
- Rock Version: Rock McKinley 13.6 (1.13.6.1)
- Client Culture Setting: en-US