progressivetech / net.ourpowerbase.sumfields

The Summary Fields extension creates read-only custom data fields that extend Contact and are automatically populated with up-to-date totals such as total lifetime contributions, last contribution amount, last attended event, etc.
Other
8 stars 29 forks source link

Calculation error #49

Closed laryn closed 5 years ago

laryn commented 5 years ago

I'm running into something that seems like a bug. I've disabled/uninstalled and then reinstalled and see the same thing.

The situation is this:

The outcome:

Likewise if someone registers two people for basic registration ($100 for one, $100 for the other) we're seeing the summary field show $400 as the summary amount rather than $200.

jmcclelland commented 5 years ago

This latest version made a change that affected how quantities are calculated which may be contributing to this bug. I haven't yet confirmed.

eileenmcnaughton commented 5 years ago

@jmcclelland I CAN confirm this commit https://github.com/progressivetech/net.ourpowerbase.sumfields/commit/28afbe40d21dcf8d05f1959cb8f826d575df360f is doing VERY bad things to the totals :-(

We have lots of contacts being acknowledged for their gifts & it turns out that as they have 2 line items - one of $0 value - we were about to acknowledge them for double their donations!

I think switching to line_total instead of total_amount in this line will work -

.sumfields/commit/28afbe40d21dcf8d05f1959cb8f826d575df360f#diff-2ed8b3d30faed4caf82736f4278b7cc0R105

jmcclelland commented 5 years ago

Thanks again Eileen. Closing this out.