CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Sumfields Modification
Pages: [1]

Author Topic: Sumfields Modification  (Read 302 times)

John Richardson

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 0
    • Life Challenge of Southeastern Michigan
  • CiviCRM version: 4.5.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.27
  • PHP version: 5.3.13
Sumfields Modification
November 13, 2013, 05:41:34 pm
Please help! I'd like to add a custom field to the Sumfields extension based on a calculation for "total tax-deductible contributions this year" This would be the difference between two sums, one that already exists in the sumfields array, namely the "total contributions for this year," and the other that would be a new custom field added to the custom group, namely the "total non-deductible contributions for this year" (based on the existing field, "non_deductible_amount" in the "civicrm_contribution" table)

I know there are a number of custom fields created by the Sumfields extension and I am assuming that all the code for this exists in the directory for the extension. But which files to hack and how? Just the "custom.php" file? Can anyone get me started?

I am pretty sure I can model a new custom field for "total non-deductible contributions this year" on the code for "total contributions for this year" already in the code in the custom.php file. I should be able to just change the field references and the label. Same table, "civicrm_contributions" right? Maybe someone else has already done this. Hope so. Seems like it should have been thought of in the original SumFields extension.

Anyone else interested in this calculated field: "total tax-deductible contributions for this year"? Wouldn't it just need to look like this somewhere in the custom.php file:

Code: [Select]
SELECT SUM(Total Contributions This Year - Total Non-Deductible Contributions This Year) as "Total Tax-Deductible Contributions This Year "
FROM civicrm_contributions;
?
« Last Edit: November 13, 2013, 07:33:30 pm by ideaman »
John Richardson

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Sumfields Modification

This forum was archived on 2017-11-26.