diff --git a/CRM/Financial/BAO/Payment.php b/CRM/Financial/BAO/Payment.php index 269cbc8b40f2..f1ca8077090a 100644 --- a/CRM/Financial/BAO/Payment.php +++ b/CRM/Financial/BAO/Payment.php @@ -574,11 +574,10 @@ protected static function getPayableLineItems($params, $contribution): array { else { $lineItems[$lineItemID]['allocation'] = round($lineItems[$lineItemID]['balance'] * $ratio, 2); } + } - if (!empty($lineItem['tax_amount'])) { - $lineItems[$lineItemID]['tax_allocation'] = round($lineItem['tax_amount'] * ($params['total_amount'] / $contribution['total_amount']), 2); - } - + if (!empty($lineItem['tax_amount'])) { + $lineItems[$lineItemID]['tax_allocation'] = round($lineItem['tax_amount'] * ($params['total_amount'] / $contribution['total_amount']), 2); } }