Fixed: Resolve issue where retail price shows as "NaN" after entering the pre-tax retail price
Co-authored-by: Name <sumit201@webkul.in>
This commit is contained in:
@@ -97,7 +97,7 @@ function removeTaxes(price)
|
||||
|
||||
function getEcotaxTaxIncluded()
|
||||
{
|
||||
return ps_round(ecotax_tax_excl * (1 + ecotaxTaxRate), 2);
|
||||
return ps_round((isNaN(ecotax_tax_excl) ? 0 : ecotax_tax_excl) * (1 + ecotaxTaxRate), 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,8 @@ function calcPriceTI()
|
||||
|
||||
function calcPriceTE()
|
||||
{
|
||||
ecotax_tax_excl = $('#ecotax').val() / (1 + ecotaxTaxRate);
|
||||
var ecotaxValue = parseFloat($('#ecotax').val());
|
||||
ecotax_tax_excl = isNaN(ecotaxValue) ? 0 : (ecotaxValue / (1 + ecotaxTaxRate));
|
||||
var priceTI = parseFloat($('#priceTI').val().replace(/,/g, '.'));
|
||||
var newPrice = removeTaxes(ps_round(priceTI - getEcotaxTaxIncluded(), priceDisplayPrecision));
|
||||
var tourismTaxIncluded = getTourismTaxIncluded(newPrice);
|
||||
|
||||
Reference in New Issue
Block a user