CRM-16278 add financial type field to pledge reports
authoreileen <emcnaughton@wikimedia.org>
Mon, 18 Jan 2016 22:05:47 +0000 (11:05 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 18 Jan 2016 22:06:41 +0000 (11:06 +1300)
CRM/Report/Form/Pledge/Detail.php
CRM/Report/Form/Pledge/Summary.php

index fc0b48e14773ddd0f0d58cd9b8959cd2476e5f35..3e8e93410701a12db70319519307be4ee434c35f 100644 (file)
@@ -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']) {
index 92aeb446d98dea50e6900abf6971bb27d6152d73..d0f304f4f9ff6c968283de100a6e660c00c897ff 100644 (file)
@@ -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']) {