|
|
|
|
|
|
|
|
|
|
|
|
|
|
function opendistrib_products_event_price() { |
|
|
function opendistrib_products_event_price() { |
|
|
taxRateSelected = $('#product-id_tax_rate').find('option:selected').data('tax-rate-value'); |
|
|
taxRateSelected = $('#product-id_tax_rate').find('option:selected').data('tax-rate-value'); |
|
|
|
|
|
if (typeof taxRateSelected == 'undefined') { |
|
|
|
|
|
taxRateSelected = 0; |
|
|
|
|
|
} |
|
|
var priceWithTax = $('#product-price-with-tax').val(); |
|
|
var priceWithTax = $('#product-price-with-tax').val(); |
|
|
|
|
|
|
|
|
if (priceWithTax) { |
|
|
if (priceWithTax) { |
|
|
$('#product-price').val(getPrice(priceWithTax, taxRateSelected)); |
|
|
$('#product-price').val(getPrice(priceWithTax, taxRateSelected)); |
|
|
// formattage |
|
|
// formattage |
|
|
|
|
|
|
|
|
$('#productprice-price-with-tax').val(getPriceWithTax(price, taxRateValue)); |
|
|
$('#productprice-price-with-tax').val(getPriceWithTax(price, taxRateValue)); |
|
|
// formattage |
|
|
// formattage |
|
|
$('#productprice-price').val(parseFloat(price).toFixed(5)); |
|
|
$('#productprice-price').val(parseFloat(price).toFixed(5)); |
|
|
|
|
|
|
|
|
opendistrib_product_prices_update_reduction_increase(); |
|
|
opendistrib_product_prices_update_reduction_increase(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$('#productprice-price').val(getPrice(priceWithTax, taxRateValue)); |
|
|
$('#productprice-price').val(getPrice(priceWithTax, taxRateValue)); |
|
|
// formattage |
|
|
// formattage |
|
|
$('#productprice-price-with-tax').val(parseFloat(priceWithTax).toFixed(2)); |
|
|
$('#productprice-price-with-tax').val(parseFloat(priceWithTax).toFixed(2)); |
|
|
|
|
|
|
|
|
opendistrib_product_prices_update_reduction_increase(); |
|
|
opendistrib_product_prices_update_reduction_increase(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |