Skip to content

Commit

Permalink
COMCL-741: Fix credit note allocations for contributions without line…
Browse files Browse the repository at this point in the history
… items

Fix code changes in pr that is partially included in 5.74.0: civicrm#29823
  • Loading branch information
Muhammad Shahrukh authored and shahrukh-compuco committed Aug 27, 2024
1 parent 091ab2d commit f34ca57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Financial/BAO/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ protected static function getPayableItems(array $params, array $contribution): a
$payableItems[$payableItemIndex] = $item;
}

if (empty($lineItemOverrides) && !empty($ratio)) {
if (empty($lineItemOverrides) && !empty($ratio) && isset($payableItems[$payableItemIndex])) {
$totalTaxAllocation = array_sum(array_column($payableItems, 'tax_allocation'));
$totalAllocation = array_sum(array_column($payableItems, 'allocation'));
$total = $totalTaxAllocation + $totalAllocation;
Expand Down

0 comments on commit f34ca57

Please sign in to comment.