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

Inconsistent temp table field size on money type #88

Closed semseysandor closed 3 years ago

semseysandor commented 3 years ago

After enabling a money type custom field (e.g. Total Lifetime Contributions), the created field in the Database will have decimal(20,2) type. However the temporary table, which is used during (re)generating data uses a decimal(10,2) type.

This means that if a contact's lifetime contributions gets above 10 decimals - which can happen as our currency (HUF) is not really strong, so it's not an unrealistic amount - data generation will fail as the calculated value can't be inserted into the temp table.

This patch eliminates this inconsistency.

jmcclelland commented 3 years ago

Thanks for the contribution!