Skip to content

Commit

Permalink
Simplify updatedAmount calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Feb 27, 2025
1 parent 0bb26b0 commit 7b735e9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions CRM/Price/BAO/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,16 +604,7 @@ public static function changeFeeSelections(

$lineItemObj->addLineItemOnChangeFeeSelection($requiredChanges['line_items_to_add'], $entityID, $entityTable, $contributionId);

$count = 0;
if ($entity == 'participant') {
$count = count(CRM_Event_BAO_Participant::getParticipantIds($contributionId));
}
else {
$count = civicrm_api3('MembershipPayment', 'getcount', ['contribution_id' => $contributionId]);
}
if ($count > 1) {
$updatedAmount = CRM_Price_BAO_LineItem::getLineTotal($contributionId);
}
$updatedAmount = CRM_Price_BAO_LineItem::getLineTotal($contributionId);
$displayParticipantCount = '';
if ($totalParticipant > 0) {
$displayParticipantCount = ' Participant Count -' . $totalParticipant;
Expand Down

0 comments on commit 7b735e9

Please sign in to comment.