Skip to content

Commit

Permalink
reporting civicrm#12 hack - support financial type custom fields on c…
Browse files Browse the repository at this point in the history
…ontribution reports
  • Loading branch information
MegaphoneJon committed Apr 12, 2020
1 parent 5d9d205 commit ba2f586
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CRM/Core/BAO/CustomQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public function getFields() {
'Address' => 'civicrm_address',
'Campaign' => 'civicrm_campaign',
'Survey' => 'civicrm_survey',
'FinancialType' => 'civicrm_financial_type',
];

/**
Expand Down
1 change: 1 addition & 0 deletions CRM/Report/Form/Contribute/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form {
'Contact',
'Individual',
'Contribution',
'FinancialType',
];

protected $groupConcatTested = TRUE;
Expand Down
1 change: 1 addition & 0 deletions CRM/Report/Form/Contribute/SoftCredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form {
'Contact',
'Individual',
'Contribution',
'FinancialType',
];

public $_drilldownReport = ['contribute/detail' => 'Link to Detail Report'];
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Form/Contribute/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
'barChart' => 'Bar Chart',
'pieChart' => 'Pie Chart',
];
protected $_customGroupExtends = ['Contribution', 'Contact', 'Individual'];
protected $_customGroupExtends = ['Contribution', 'Contact', 'Individual', 'FinancialType'];
protected $_customGroupGroupBy = TRUE;

public $_drilldownReport = ['contribute/detail' => 'Link to Detail Report'];
Expand Down
2 changes: 1 addition & 1 deletion api/v3/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ function _civicrm_api3_basic_create($bao_name, &$params, $entity = NULL) {
else {
// If we have custom fields the BAO may have taken care of it or we may have to.
// $extendsMap provides a pretty good hard-coded list of BAOs that take care of the custom data.
if (isset($params['custom']) && empty(CRM_Core_BAO_CustomQuery::$extendsMap[$entity])) {
if (isset($params['custom']) && (empty(CRM_Core_BAO_CustomQuery::$extendsMap[$entity]) || $entity == 'FinancialType')) {
CRM_Core_BAO_CustomValueTable::store($params['custom'], CRM_Core_DAO_AllCoreTables::getTableForClass(CRM_Core_DAO_AllCoreTables::getFullName($entity)), $bao->id);
}
$values = [];
Expand Down

0 comments on commit ba2f586

Please sign in to comment.