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
|
// Update an input
|
||||||
if (ui.item.update) {
|
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) {
|
$.each(ui.item.update, function(key, value) {
|
||||||
$("#" + key).val(value).trigger("change");
|
$("#" + key).val(value).trigger("change");
|
||||||
});
|
});
|
||||||
|
|||||||
@ -385,9 +385,9 @@ $(document).ready(function() {
|
|||||||
$('#price_ttc').attr('disabled','disabled');
|
$('#price_ttc').attr('disabled','disabled');
|
||||||
$('#price_ttc').val('');
|
$('#price_ttc').val('');
|
||||||
} else {
|
} else {
|
||||||
if ($('#idprod').val() == 0) {
|
// Enable excl.VAT field
|
||||||
$('#price_ttc').removeAttr('disabled');
|
$('#price_ttc').removeAttr('disabled');
|
||||||
}
|
// Update prices fields
|
||||||
if ($('#price_base_type').val() == 'HT') {
|
if ($('#price_base_type').val() == 'HT') {
|
||||||
update_price('price_ht', 'price_ttc');
|
update_price('price_ht', 'price_ttc');
|
||||||
} else if ($('#price_base_type').val() == 'TTC') {
|
} else if ($('#price_base_type').val() == 'TTC') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user