From: eileen Date: Mon, 18 Jan 2016 22:05:47 +0000 (+1300) Subject: CRM-16278 add financial type field to pledge reports X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9e3353087f3591ce01ecd0fa5526bdaf365bc2b7;p=civicrm-core.git CRM-16278 add financial type field to pledge reports --- diff --git a/CRM/Report/Form/Pledge/Detail.php b/CRM/Report/Form/Pledge/Detail.php index fc0b48e147..3e8e934107 100644 --- a/CRM/Report/Form/Pledge/Detail.php +++ b/CRM/Report/Form/Pledge/Detail.php @@ -102,6 +102,9 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'financial_type_id' => array( + 'title' => ts('Financial Type'), + ), 'amount' => array( 'title' => ts('Pledge Amount'), 'required' => TRUE, @@ -155,6 +158,11 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('contribution_status'), ), + 'financial_type_id' => array( + 'title' => ts('Financial Type'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Contribute_PseudoConstant::financialType(), + ), ), ), @@ -559,6 +567,13 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { $entryFound = TRUE; } + if (array_key_exists('civicrm_pledge_financial_type_id', $row)) { + if ($value = $row['civicrm_pledge_financial_type_id']) { + $rows[$rowNum]['civicrm_pledge_financial_type_id'] = CRM_Contribute_PseudoConstant::financialType($value, FALSE); + } + $entryFound = TRUE; + } + //handle status id if (array_key_exists('civicrm_pledge_status_id', $row)) { if ($value = $row['civicrm_pledge_status_id']) { diff --git a/CRM/Report/Form/Pledge/Summary.php b/CRM/Report/Form/Pledge/Summary.php index 92aeb446d9..d0f304f4f9 100644 --- a/CRM/Report/Form/Pledge/Summary.php +++ b/CRM/Report/Form/Pledge/Summary.php @@ -85,6 +85,9 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { 'no_display' => TRUE, 'required' => FALSE, ), + 'financial_type_id' => array( + 'title' => ts('Financial Type'), + ), 'currency' => array( 'required' => TRUE, 'no_display' => TRUE, @@ -142,6 +145,11 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('contribution_status'), ), + 'financial_type_id' => array( + 'title' => ts('Financial Type'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Contribute_PseudoConstant::financialType(), + ), ), 'group_bys' => array( 'pledge_create_date' => array( @@ -391,6 +399,13 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { $entryFound = TRUE; } + if (array_key_exists('civicrm_pledge_financial_type_id', $row)) { + if ($value = $row['civicrm_pledge_financial_type_id']) { + $rows[$rowNum]['civicrm_pledge_financial_type_id'] = CRM_Contribute_PseudoConstant::financialType($value, FALSE); + } + $entryFound = TRUE; + } + //handle status id if (array_key_exists('civicrm_pledge_status_id', $row)) { if ($value = $row['civicrm_pledge_status_id']) {