Fix: clear old data before update
This commit is contained in:
parent
327e51ccd9
commit
13d46da3fe
@ -139,6 +139,11 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
||||
}
|
||||
// Update an input
|
||||
if (ui.item.update) {
|
||||
// clear old data before update
|
||||
$.each(ui.item.update, function(key, value) {
|
||||
$("#" + key).val("");
|
||||
});
|
||||
// update fields
|
||||
$.each(ui.item.update, function(key, value) {
|
||||
$("#" + key).val(value).trigger("change");
|
||||
});
|
||||
|
||||
@ -385,9 +385,9 @@ $(document).ready(function() {
|
||||
$('#price_ttc').attr('disabled','disabled');
|
||||
$('#price_ttc').val('');
|
||||
} else {
|
||||
if ($('#idprod').val() == 0) {
|
||||
$('#price_ttc').removeAttr('disabled');
|
||||
}
|
||||
// Enable excl.VAT field
|
||||
$('#price_ttc').removeAttr('disabled');
|
||||
// Update prices fields
|
||||
if ($('#price_base_type').val() == 'HT') {
|
||||
update_price('price_ht', 'price_ttc');
|
||||
} else if ($('#price_base_type').val() == 'TTC') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user