Skip to content
Snippets Groups Projects
Commit f480d851 authored by Dave Greenberg's avatar Dave Greenberg
Browse files

Applied patch from Helen Bergin to include multiple contributions in same year...

Applied patch from Helen Bergin to include multiple contributions in same year in totals. Also fixed fatal error for this report in 4.3 - getOperationPair needs to be defined as a static function.
parent cf5c22ba
Branches
Tags
No related merge requests found
......@@ -293,10 +293,6 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
continue;
}
if ($fieldName == 'total_amount') {
$select[] = "SUM({$field['dbAlias']}) as {$tableName}_{$fieldName}";
}
if (CRM_Utils_Array::value('is_statistics', $field)) {
$this->_columnHeaders[$fieldName]['type'] = $field['type'];
$this->_columnHeaders[$fieldName]['title'] = $field['title'];
......@@ -313,6 +309,9 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
$select[] = " YEAR(".$field['dbAlias'].")" . " as {$tableName}_{$fieldName}";
}
}
elseif ($fieldName == 'total_amount') {
$select[] = "SUM({$field['dbAlias']}) as {$tableName}_{$fieldName}";
}
else {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
$this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
......@@ -685,7 +684,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
}
// Override "This Year" $op options
function getOperationPair($type = "string", $fieldName = NULL) {
static function getOperationPair($type = "string", $fieldName = NULL) {
if ($fieldName == 'this_year' || $fieldName == 'other_year') {
return array('calendar' => ts('Is Calendar Year'), 'fiscal' => ts('Fiscal Year Starting'));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment