[-] BO: Fix ecotax product backoffice management && rounding issue

This commit is contained in:
rGaillard committed 2012-10-09 12:58:08 +00:00
1 parent 1c6291c680
commit 1dd63c93b0
6 files changed
+62 -39

No files matched your search

+5 -4
View File
@@ -35,12 +35,12 @@ function getTax()
function getEcotaxTaxIncluded()
{
return ($('#ecotax').length && $('#ecotax').val() != '') ? parseFloat($('#ecotax').val()) : 0;
return ps_round(ecotax_tax_excl * (1 + ecotaxTaxRate), 2);
}
function getEcotaxTaxExcluded()
{
return getEcotaxTaxIncluded() / (1 + ecotaxTaxRate);
return ecotax_tax_excl;
}
function formatPrice(price)
@@ -70,12 +70,13 @@ function calcPriceTI()
document.getElementById('finalPriceWithoutTax').innerHTML = (isNaN(priceTE) == true || priceTE < 0) ? '' :
(ps_round(priceTE, 2) + getEcotaxTaxExcluded()).toFixed(2);
calcReduction();
$('#priceTI').value = (parseFloat($('#priceTI').val()) + getEcotaxTaxIncluded()).toFixed(2);
$('#finalPrice').innerHTML = parseFloat($('#priceTI').val()).toFixed(2);
$('#priceTI').val((parseFloat($('#priceTI').val()) + getEcotaxTaxIncluded()).toFixed(2));
$('#finalPrice').html(parseFloat($('#priceTI').val()).toFixed(2));
}
function calcPriceTE()
{
ecotax_tax_excl = $('#ecotax').val() / (1 + ecotaxTaxRate);
var tax = getTax();
var priceTI = parseFloat(document.getElementById('priceTI').value.replace(/,/g, '.'));
var newPrice = ps_round(priceTI - getEcotaxTaxIncluded(), 2) / ((tax / 100) + 1);