Skip to content
Snippets Groups Projects
Commit 0e9ac29b authored by yashodha's avatar yashodha
Browse files

(#4106) Add filter on pledge payment in contribution report templates

parent e758a0c1
Branches
Tags
No related merge requests found
......@@ -255,6 +255,14 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form {
],
'grouping' => 'contri-fields',
],
'civicrm_pledge_payment' => [
'dao' => 'CRM_Pledge_DAO_PledgePayment',
'filters' => [
'contribution_id' => [
'title' => ts('Contribution is a pledge payment'),
],
],
],
'civicrm_contribution_soft' => [
'dao' => 'CRM_Contribute_DAO_ContributionSoft',
'fields' => [
......@@ -986,6 +994,13 @@ WHERE civicrm_contribution_contribution_id={$row['civicrm_contribution_contribu
$this->joinAddressFromContact();
$this->joinEmailFromContact();
//for pledge payment
if ($this->isTableSelected('civicrm_pledge_payment')) {
$this->_from .= "
LEFT JOIN civicrm_pledge_payment {$this->_aliases['civicrm_pledge_payment']} ON {$this->_aliases['civicrm_contribution']}.id = {$this->_aliases['civicrm_pledge_payment']}.contribution_id
";
}
// include contribution note
if (!empty($this->_params['fields']['contribution_note']) ||
!empty($this->_params['note_value'])
......
......@@ -284,6 +284,14 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
'batch_id' => ['title' => ts('Batch Title')],
],
],
'civicrm_pledge_payment' => [
'dao' => 'CRM_Pledge_DAO_PledgePayment',
'filters' => [
'contribution_id' => [
'title' => ts('Contribution is a pledge payment'),
],
],
],
'civicrm_contribution_soft' => [
'dao' => 'CRM_Contribute_DAO_ContributionSoft',
'fields' => [
......@@ -527,6 +535,13 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
$this->joinPhoneFromContact();
$this->joinEmailFromContact();
//for pledge payment
if ($this->isTableSelected('civicrm_pledge_payment')) {
$this->_from .= "
LEFT JOIN civicrm_pledge_payment {$this->_aliases['civicrm_pledge_payment']} ON {$this->_aliases['civicrm_contribution']}.id = {$this->_aliases['civicrm_pledge_payment']}.contribution_id
";
}
//for contribution batches
if ($this->isTableSelected('civicrm_batch')) {
$this->_from .= "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment