'total_amount' => CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($totalAmount),
'total_amount_numeric' => $totalAmount,
'auto_renew' => $values['auto_renew'] ?? NULL,
+ 'tax_rate' => $values['tax_rate'],
'has_related' => isset($values['relationship_type_id']),
'max_related' => $values['max_related'] ?? NULL,
];
// skip this for test and live modes because financial type is set automatically
cj("#financial_type_id").val(membershipType['financial_type_id']);
var term = cj('#num_terms').val();
- var taxRates = {/literal}{$taxRates}{literal};
var taxTerm = {/literal}{$taxTerm|@json_encode}{literal};
- var taxRate = taxRates[membershipType['financial_type_id']];
var currency = {/literal}{$currency_symbol|@json_encode}{literal};
var taxExclusiveAmount = membershipType['total_amount_numeric'] * term;
- var taxAmount = (taxRate/100)*taxExclusiveAmount;
+ var taxAmount = (membershipType['tax_rate']/100)*taxExclusiveAmount;
taxAmount = isNaN (taxAmount) ? 0:taxAmount;
cj("#total_amount").val(CRM.formatMoney(taxExclusiveAmount + taxAmount, true));
- var taxMessage = taxRate!=undefined ? 'Includes '+taxTerm+' amount of '+currency+' '+taxAmount:'';
+ var taxMessage = taxAmount > 0 ? 'Includes '+taxTerm+' amount of '+currency+' '+taxAmount:'';
cj('.totaltaxAmount').html(taxMessage);
}