This commit is contained in:
Laurent Destailleur
2022-09-25 12:36:57 +02:00
parent ca85255676
commit c9fb24cebe
2 changed files with 13 additions and 6 deletions

View File

@@ -143,15 +143,20 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
textarea[key] = item[value];
});
}
console.log("Return value from GET to the rest of code");
return { label: label, value: item.value, id: item.key, disabled: item.disabled,
update: update, textarea: textarea,
update: update,
textarea: textarea,
pbq: item.pbq,
type: item.type, qty: item.qty, discount: item.discount,
type: item.type,
qty: item.qty,
discount: item.discount,
pricebasetype: item.pricebasetype,
price_ht: item.price_ht,
price_ttc: item.price_ttc,
description : item.description,
ref_customer: item.ref_customer }
ref_customer: item.ref_customer,
tva_tx: item.tva_tx }
}));
} else {
console.error("Error: Ajax url '.$url.($urloption ? '?'.$urloption : '').' has returned an empty page. Should be an empty json array.");
@@ -173,6 +178,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
$("#'.$htmlnamejquery.'").attr("data-discount", ui.item.discount);
$("#'.$htmlnamejquery.'").attr("data-description", ui.item.description);
$("#'.$htmlnamejquery.'").attr("data-ref-customer", ui.item.ref_customer);
$("#'.$htmlnamejquery.'").attr("data-tvatx", ui.item.tva_tx);
';
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
$script .= '