From e29d24ad0250cc87b0c8bc371ebbba0683a21518 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Fri, 12 May 2017 02:43:13 +0530 Subject: [PATCH] CRM-20560, fixed join so that its pointed to correct financial type ---------------------------------------- * CRM-20560: Deferred Revenue report bug https://issues.civicrm.org/jira/browse/CRM-20560 --- CRM/Report/Form/Contribute/DeferredRevenue.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CRM/Report/Form/Contribute/DeferredRevenue.php b/CRM/Report/Form/Contribute/DeferredRevenue.php index 542586f5f5..9447082bc8 100644 --- a/CRM/Report/Form/Contribute/DeferredRevenue.php +++ b/CRM/Report/Form/Contribute/DeferredRevenue.php @@ -60,6 +60,7 @@ class CRM_Report_Form_Contribute_DeferredRevenue extends CRM_Report_Form { 'title' => ts('Transaction Amount'), 'type' => CRM_Utils_Type::T_MONEY, 'required' => TRUE, + 'dbAlias' => 'SUM(financial_trxn_1_civireport.total_amount )', ), ), 'filters' => array( @@ -317,6 +318,7 @@ class CRM_Report_Form_Contribute_DeferredRevenue extends CRM_Report_Form { ON {$this->_aliases['civicrm_contribution']}.id = financial_trxn_contribution.entity_id INNER JOIN civicrm_line_item line_item ON line_item.contribution_id = {$this->_aliases['civicrm_contribution']}.id + AND line_item.financial_type_id = entity_financial_account_deferred.entity_id LEFT JOIN civicrm_participant {$this->_aliases['civicrm_participant']} ON CASE WHEN line_item.entity_table = 'civicrm_participant' -- 2.25.1