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:
amit sharma
2026-09-22 14:53:46 +05:30
parent de6ecd72f0
commit d19bb30bce

View File

@@ -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);