Made update price synchronous to avoid dependency hell

This commit is contained in:
Raphaël Doursenaud 2013-11-21 18:00:27 +01:00
parent 7945011955
commit 302a230bf2

View File

@ -423,12 +423,15 @@ $(document).ready(function() {
});
function update_price(input, output) {
$.post('<?php echo DOL_URL_ROOT; ?>/core/ajax/price.php', {
$.ajax({
type: 'POST',
url: '<?php echo DOL_URL_ROOT; ?>/core/ajax/price.php',
data: {
'amount': $('#' + input).val(),
'output': output,
'tva_tx': $('#tva_tx').val()
},
function(data) {
success: function(data) {
var addline=false;
if (typeof data[output] != 'undefined') {
// Hide price_ttc if no vat
@ -456,7 +459,9 @@ $(document).ready(function() {
} else {
$('#addlinebutton').attr('disabled','disabled');
}
}, 'json');
},
dataType: 'json',
async: false});
}
function getVATRates(action, htmlname, idprod) {