Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20967, use is_payment = TRUE to retrieve payments #10763

Merged
merged 1 commit into from
Jul 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions CRM/Report/Form/Event/ParticipantListing.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ public function __construct() {
'participant_register_date' => array('title' => ts('Registration Date')),
'total_paid' => array(
'title' => ts('Total Paid'),
'dbAlias' => 'SUM(ft.total_amount)',
'dbAlias' => 'IFNULL(SUM(ft.total_amount), 0)',
'type' => 1024,
),
'balance' => array(
'title' => ts('Balance'),
'dbAlias' => 'participant_civireport.fee_amount - SUM(ft.total_amount)',
'dbAlias' => 'participant_civireport.fee_amount - IFNULL(SUM(ft.total_amount), 0)',
'type' => 1024,
),
),
Expand Down Expand Up @@ -563,14 +563,9 @@ public function from() {
$this->_from .= "
LEFT JOIN civicrm_entity_financial_trxn eft
ON (eft.entity_id = {$this->_aliases['civicrm_contribution']}.id)
LEFT JOIN civicrm_financial_account fa
ON (fa.account_type_code = 'AR')
LEFT JOIN civicrm_financial_account fae
ON (fae.account_type_code = 'EXP')
LEFT JOIN civicrm_financial_trxn ft
ON (ft.id = eft.financial_trxn_id AND eft.entity_table = 'civicrm_contribution') AND
(ft.to_financial_account_id != fa.id) AND
(ft.to_financial_account_id != fae.id)
(ft.is_payment = 1)
";
}
}
Expand Down