From 6d0e864f59deb1da1f9d18cad363fc6fb7e9b94d Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Wed, 10 Feb 2016 15:28:37 +0530 Subject: [PATCH] CRM-17993 -- Participant Listing Report: total paid doubled when multiple fee options selected --- CRM/Report/Form/Event/ParticipantListing.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index b26974d464..c296bd3e8a 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -37,7 +37,6 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { protected $_summary = NULL; protected $_contribField = FALSE; - protected $_lineitemField = FALSE; protected $_groupFilter = TRUE; protected $_tagFilter = TRUE; protected $_balance = FALSE; @@ -452,9 +451,6 @@ ORDER BY cv.label $this->_columnHeaders['blankColumnBegin']['title'] = '_ _ _ _'; } foreach ($this->_columns as $tableName => $table) { - if ($tableName == 'civicrm_line_item') { - $this->_lineitemField = TRUE; - } if (array_key_exists('fields', $table)) { foreach ($table['fields'] as $fieldName => $field) { if (!empty($field['required']) || @@ -465,6 +461,9 @@ ORDER BY cv.label } if ($fieldName == 'total_paid' || $fieldName == 'balance') { $this->_balance = TRUE; + if (!empty($this->_params['price_field_value_id_value'])) { + $field['dbAlias'] = str_replace('SUM(ft.total_amount)', 'ft.total_amount', $field['dbAlias']); + } } $alias = "{$tableName}_{$fieldName}"; $select[] = "{$field['dbAlias']} as $alias"; @@ -527,7 +526,7 @@ ORDER BY cv.label ON (pp.contribution_id = {$this->_aliases['civicrm_contribution']}.id) "; } - if ($this->_lineitemField) { + if (!empty($this->_params['price_field_value_id_value'])) { $this->_from .= " LEFT JOIN civicrm_line_item line_item_civireport ON line_item_civireport.entity_table = 'civicrm_participant' AND -- 2.25.1