From 25d0c6478ee236a4ac150e8d2b39614602ca4ae8 Mon Sep 17 00:00:00 2001 From: Web Access Date: Tue, 2 Jun 2015 12:27:01 +0530 Subject: [PATCH] Fix for CRM-16565 --- CRM/Contribute/Form/Task/Invoice.php | 2 +- CRM/Price/BAO/LineItem.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/Task/Invoice.php b/CRM/Contribute/Form/Task/Invoice.php index 9693c4b769..6b004586ee 100644 --- a/CRM/Contribute/Form/Task/Invoice.php +++ b/CRM/Contribute/Form/Task/Invoice.php @@ -327,7 +327,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { else { $eid = $contribution->_relatedObjects['participant']->id; $etable = 'participant'; - $lineItem = CRM_Price_BAO_LineItem::getLineItems($eid, $etable); + $lineItem = CRM_Price_BAO_LineItem::getLineItems($eid, $etable, NULL, TRUE, FALSE, '', TRUE); } //TO DO: Need to do changes for partially paid to display amount due on PDF invoice diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 4ae8375f9e..c442239706 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -143,6 +143,7 @@ AND li.entity_id = {$entityId} * @param null $isQuick * @param bool $isQtyZero * @param bool $relatedEntity + * @param bool $invoice * * @param string $overrideWhereClause * E.g "WHERE contribution id = 7 " per the getLineItemsByContributionID wrapper. @@ -152,7 +153,7 @@ AND li.entity_id = {$entityId} * @return array * Array of line items */ - public static function getLineItems($entityId, $entity = 'participant', $isQuick = NULL, $isQtyZero = TRUE, $relatedEntity = FALSE, $overrideWhereClause = '') { + public static function getLineItems($entityId, $entity = 'participant', $isQuick = NULL, $isQtyZero = TRUE, $relatedEntity = FALSE, $overrideWhereClause = '', $invoice = FALSE) { $whereClause = $fromClause = NULL; $selectClause = " SELECT li.id, @@ -187,7 +188,8 @@ AND li.entity_id = {$entityId} $whereClause = " WHERE %2.id = %1"; - if ($entity == 'participant') { + // CRM-16250 get additional participant's fee selection details only for invoice PDF (if any) + if ($entity == 'participant' && $invoice) { $additionalParticipantIDs = CRM_Event_BAO_Participant::getAdditionalParticipantIds($entityId); if (!empty($additionalParticipantIDs)) { $whereClause = "WHERE %2.id IN (%1, " . implode(', ', $additionalParticipantIDs) . ")"; -- 2.25.1