Skip to content

Commit

Permalink
Merge pull request #23038 from eileenmcnaughton/assign3
Browse files Browse the repository at this point in the history
Assign totalTaxAmount more consistently
  • Loading branch information
colemanw authored Apr 6, 2022
2 parents aed012a + 99cdcf5 commit dead29a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -1659,18 +1659,14 @@ public function buildEventFeeForm($form) {
CRM_Event_Form_Registration::initEventFee($form, $event['id'], FALSE);
CRM_Event_Form_Registration_Register::buildAmount($form, TRUE, $form->_discountId);
$lineItem = [];
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$invoicing = $invoiceSettings['invoicing'] ?? NULL;
$totalTaxAmount = 0;
if (!CRM_Utils_System::isNull(CRM_Utils_Array::value('line_items', $form->_values))) {
$lineItem[] = $form->_values['line_items'];
foreach ($form->_values['line_items'] as $key => $value) {
$totalTaxAmount = $value['tax_amount'] + $totalTaxAmount;
}
}
if ($invoicing) {
$form->assign('totalTaxAmount', $totalTaxAmount);
}
$form->assign('totalTaxAmount', Civi::settings()->get('invoicing') ? ($totalTaxAmount ?? NULL) : NULL);
$form->assign('lineItem', empty($lineItem) ? FALSE : $lineItem);
$discounts = [];
if (!empty($form->_values['discount'])) {
Expand Down

0 comments on commit dead29a

Please sign in to comment.