Skip to content

Commit

Permalink
Merge pull request #16251 from eileenmcnaughton/line_clean
Browse files Browse the repository at this point in the history
[REF] Remove never-passed param from getLineItems
  • Loading branch information
mattwire authored Jan 9, 2020
2 parents 8165a97 + ca5c1e4 commit 0f589a1
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions CRM/Price/BAO/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,10 @@ public static function getLineItemsByContributionID($contributionID) {
* @param bool $isQtyZero
* @param bool $relatedEntity
*
* @param bool $invoice
* @return array
* Array of line items
*/
public static function getLineItems($entityId, $entity = 'participant', $isQuick = FALSE, $isQtyZero = TRUE, $relatedEntity = FALSE, $invoice = FALSE) {
public static function getLineItems($entityId, $entity = 'participant', $isQuick = FALSE, $isQtyZero = TRUE, $relatedEntity = FALSE) {
$whereClause = $fromClause = NULL;
$selectClause = "
SELECT li.id,
Expand Down Expand Up @@ -218,17 +217,7 @@ public static function getLineItems($entityId, $entity = 'participant', $isQuick
LEFT JOIN civicrm_line_item li ON ({$condition})
LEFT JOIN civicrm_price_field_value pfv ON ( pfv.id = li.price_field_value_id )
LEFT JOIN civicrm_price_field pf ON (pf.id = li.price_field_id )";
$whereClause = "
WHERE %2.id = %1";

// 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) . ")";
}
}

$whereClause = " WHERE %2.id = %1";
$orderByClause = " ORDER BY pf.weight, pfv.weight";

if ($isQuick) {
Expand Down

0 comments on commit 0f589a1

Please sign in to comment.