CRM-17997: Fix Sybunt year totals.
authorMathieu Lutfy <mathieu@bidon.ca>
Mon, 9 May 2016 21:23:02 +0000 (17:23 -0400)
committerMathieu Lutfy <mathieu@bidon.ca>
Mon, 9 May 2016 21:23:02 +0000 (17:23 -0400)
CRM/Report/Form/Contribute/Sybunt.php

index 1625378f68aa28ead1f9cabfe03756d7782bbcb5..3d6655df15346b9bc93f6823547028da777ead57 100644 (file)
@@ -283,14 +283,14 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form {
               $this->_columnHeaders["civicrm_upto_{$upTo_year}"]['type'] = $field['type'];
               $this->_columnHeaders["civicrm_upto_{$upTo_year}"]['title'] = "Up To $upTo_year";
 
-              $this->_columnHeaders["{$previous_ppyear}"]['type'] = $field['type'];
-              $this->_columnHeaders["{$previous_ppyear}"]['title'] = $previous_ppyear;
+              $this->_columnHeaders["year_{$previous_ppyear}"]['type'] = $field['type'];
+              $this->_columnHeaders["year_{$previous_ppyear}"]['title'] = $previous_ppyear;
 
-              $this->_columnHeaders["{$previous_pyear}"]['type'] = $field['type'];
-              $this->_columnHeaders["{$previous_pyear}"]['title'] = $previous_pyear;
+              $this->_columnHeaders["year_{$previous_pyear}"]['type'] = $field['type'];
+              $this->_columnHeaders["year_{$previous_pyear}"]['title'] = $previous_pyear;
 
-              $this->_columnHeaders["{$previous_year}"]['type'] = $field['type'];
-              $this->_columnHeaders["{$previous_year}"]['title'] = $previous_year;
+              $this->_columnHeaders["year_{$previous_year}"]['type'] = $field['type'];
+              $this->_columnHeaders["year_{$previous_year}"]['title'] = $previous_year;
 
               $this->_columnHeaders["civicrm_life_time_total"]['type'] = $field['type'];
               $this->_columnHeaders["civicrm_life_time_total"]['title'] = 'LifeTime';;
@@ -484,7 +484,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form {
         if ($dao->civicrm_contribution_receive_date) {
           if ($dao->civicrm_contribution_receive_date > $upTo_year) {
             $contributionSum += $dao->civicrm_contribution_total_amount;
-            $rows[$dao->civicrm_contribution_contact_id][$dao->civicrm_contribution_receive_date] = $dao->civicrm_contribution_total_amount;
+            $rows[$dao->civicrm_contribution_contact_id]['year_' . $dao->civicrm_contribution_receive_date] = $dao->civicrm_contribution_total_amount;
           }
         }
         else {