Skip to content

Commit ba2f586

Browse files
committed
reporting civicrm#12 hack - support financial type custom fields on contribution reports
1 parent 5d9d205 commit ba2f586

File tree

5 files changed

+5
-2
lines changed

5 files changed

+5
-2
lines changed

CRM/Core/BAO/CustomQuery.php

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public function getFields() {
117117
'Address' => 'civicrm_address',
118118
'Campaign' => 'civicrm_campaign',
119119
'Survey' => 'civicrm_survey',
120+
'FinancialType' => 'civicrm_financial_type',
120121
];
121122

122123
/**

CRM/Report/Form/Contribute/Detail.php

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form {
2626
'Contact',
2727
'Individual',
2828
'Contribution',
29+
'FinancialType',
2930
];
3031

3132
protected $groupConcatTested = TRUE;

CRM/Report/Form/Contribute/SoftCredit.php

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form {
3232
'Contact',
3333
'Individual',
3434
'Contribution',
35+
'FinancialType',
3536
];
3637

3738
public $_drilldownReport = ['contribute/detail' => 'Link to Detail Report'];

CRM/Report/Form/Contribute/Summary.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
2121
'barChart' => 'Bar Chart',
2222
'pieChart' => 'Pie Chart',
2323
];
24-
protected $_customGroupExtends = ['Contribution', 'Contact', 'Individual'];
24+
protected $_customGroupExtends = ['Contribution', 'Contact', 'Individual', 'FinancialType'];
2525
protected $_customGroupGroupBy = TRUE;
2626

2727
public $_drilldownReport = ['contribute/detail' => 'Link to Detail Report'];

api/v3/utils.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ function _civicrm_api3_basic_create($bao_name, &$params, $entity = NULL) {
13151315
else {
13161316
// If we have custom fields the BAO may have taken care of it or we may have to.
13171317
// $extendsMap provides a pretty good hard-coded list of BAOs that take care of the custom data.
1318-
if (isset($params['custom']) && empty(CRM_Core_BAO_CustomQuery::$extendsMap[$entity])) {
1318+
if (isset($params['custom']) && (empty(CRM_Core_BAO_CustomQuery::$extendsMap[$entity]) || $entity == 'FinancialType')) {
13191319
CRM_Core_BAO_CustomValueTable::store($params['custom'], CRM_Core_DAO_AllCoreTables::getTableForClass(CRM_Core_DAO_AllCoreTables::getFullName($entity)), $bao->id);
13201320
}
13211321
$values = [];

0 commit comments

Comments
 (0)