Skip to content

Commit

Permalink
CSTMM-44: This pr fixes the credit note allocation to taxable line items
Browse files Browse the repository at this point in the history
This issue was introduced with civicrm#29823

This pr does not have any reference to core pr as the code has changed completely since then and this fix is not needed in latest civicrm version
  • Loading branch information
Muhammad Shahrukh authored and shahrukh-compuco committed Oct 23, 2024
1 parent 16428c2 commit a953a07
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CRM/Financial/BAO/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit a953a07

Please sign in to comment.