From 0860078dba2073079446ea4d316cabc0a3bf721e Mon Sep 17 00:00:00 2001 From: Edsel Date: Thu, 6 Apr 2017 16:00:03 +0530 Subject: [PATCH] IIDA-116 Fixed batch labels --- CRM/Report/Form/Contribute/DeferredRevenue.php | 5 ++++- tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CRM/Report/Form/Contribute/DeferredRevenue.php b/CRM/Report/Form/Contribute/DeferredRevenue.php index ae75beb6b5..542586f5f5 100644 --- a/CRM/Report/Form/Contribute/DeferredRevenue.php +++ b/CRM/Report/Form/Contribute/DeferredRevenue.php @@ -250,6 +250,9 @@ class CRM_Report_Form_Contribute_DeferredRevenue extends CRM_Report_Form { 'fields' => array( 'batch_id' => array( 'title' => ts('Batch Title'), + 'dbAlias' => "GROUP_CONCAT(DISTINCT batch_civireport.batch_id + ORDER BY batch_civireport.batch_id SEPARATOR ',')", + ), ), 'filters' => array( @@ -342,7 +345,7 @@ class CRM_Report_Form_Contribute_DeferredRevenue extends CRM_Report_Form { if ($this->isTableSelected('civicrm_batch')) { $this->_from .= " LEFT JOIN civicrm_entity_batch {$this->_aliases['civicrm_batch']} - ON {$this->_aliases['civicrm_batch']}.entity_id = {$this->_aliases['civicrm_financial_trxn_1']}.id + ON {$this->_aliases['civicrm_batch']}.entity_id = {$this->_aliases['civicrm_financial_trxn']}.id AND {$this->_aliases['civicrm_batch']}.entity_table = 'civicrm_financial_trxn'"; } } diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php index 119663684c..c1b6a2416a 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php @@ -410,13 +410,13 @@ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase { $financialAccount = CRM_Financial_BAO_FinancialAccount::getAllDeferredFinancialAccount(); // The two deferred financial accounts which are created by default. $expected = array( - "Deferred Revenue - Event Fee", - "Deferred Revenue - Member Dues", + "Deferred Revenue - Member Dues (2740)", + "Deferred Revenue - Event Fee (2730)", ); $this->assertEquals(array_count_values($expected), array_count_values($financialAccount), "The two arrays are not the same"); $this->_createDeferredFinancialAccount(); $financialAccount = CRM_Financial_BAO_FinancialAccount::getAllDeferredFinancialAccount(); - $expected[] = "TestFinancialAccount_1"; + $expected[] = "TestFinancialAccount_1 (4800)"; $this->assertEquals(array_count_values($expected), array_count_values($financialAccount), "The two arrays are not the same"); } -- 2.25.1