mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-15 22:11:36 +01:00
Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/comm/propal/list.php htdocs/core/class/html.form.class.php htdocs/core/lib/ajax.lib.php htdocs/core/tpl/objectline_create.tpl.php htdocs/product/fournisseurs.php
This commit is contained in:
@@ -137,9 +137,10 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
update: update, textarea: textarea,
|
||||
pbq: item.pbq,
|
||||
type: item.type, qty: item.qty, discount: item.discount,
|
||||
pricebasetype: item.pricebasetype, price_ht: item.price_ht,
|
||||
pricebasetype: item.pricebasetype,
|
||||
price_ht: item.price_ht,
|
||||
price_ttc: item.price_ttc,
|
||||
up: item.up, description : item.description,
|
||||
description : item.description,
|
||||
ref_customer: item.ref_customer }
|
||||
}));
|
||||
}
|
||||
@@ -152,32 +153,24 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
console.log("We will trigger change on input '.$htmlname.' because of the select definition of autocomplete code for input#search_'.$htmlname.'");
|
||||
console.log("Selected id = "+ui.item.id+" - If this value is null, it means you select a record with key that is null so selection is not effective");
|
||||
|
||||
console.log("Propagate before some properties");
|
||||
console.log("Propagate before some properties retrieved by ajax into data-xxx properties");
|
||||
|
||||
//console.log(ui.item);
|
||||
//For supplier price
|
||||
$("#'.$htmlname.'").attr("data-up", ui.item.up);
|
||||
$("#'.$htmlname.'").attr("data-discount", ui.item.discount);
|
||||
// For supplier price and customer when price by quantity is off
|
||||
$("#'.$htmlname.'").attr("data-up", ui.item.price_ht);
|
||||
$("#'.$htmlname.'").attr("data-base", ui.item.pricebasetype);
|
||||
$("#'.$htmlname.'").attr("data-qty", ui.item.qty);
|
||||
$("#'.$htmlname.'").attr("data-discount", ui.item.discount);
|
||||
$("#'.$htmlname.'").attr("data-description", ui.item.description);
|
||||
$("#'.$htmlname.'").attr("data-ref-customer", ui.item.ref_customer);
|
||||
|
||||
//For customer price
|
||||
';
|
||||
';
|
||||
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
|
||||
$script .= '
|
||||
$("#' . $htmlname . '").attr("data-pbq", ui.item.pbq);
|
||||
$("#' . $htmlname . '").attr("data-pbqup", ui.item.price_ht);
|
||||
$("#' . $htmlname . '").attr("data-pbqbase", ui.item.pricebasetype);
|
||||
$("#' . $htmlname . '").attr("data-pbqqty", ui.item.qty);
|
||||
$("#' . $htmlname . '").attr("data-pbqpercent", ui.item.discount);
|
||||
';
|
||||
} else {
|
||||
$script .= '
|
||||
$("#' . $htmlname . '").attr("data-up", ui.item.price_ht);
|
||||
$("#' . $htmlname . '").attr("data-base", ui.item.pricebasetype);
|
||||
$("#' . $htmlname . '").attr("data-qty", ui.item.qty);
|
||||
$("#' . $htmlname . '").attr("data-discount", ui.item.discount);
|
||||
// For customer price when PRODUIT_CUSTOMER_PRICES_BY_QTY is on
|
||||
$("#'.$htmlname.'").attr("data-pbq", ui.item.pbq);
|
||||
$("#'.$htmlname.'").attr("data-pbqup", ui.item.price_ht);
|
||||
$("#'.$htmlname.'").attr("data-pbqbase", ui.item.pricebasetype);
|
||||
$("#'.$htmlname.'").attr("data-pbqqty", ui.item.qty);
|
||||
$("#'.$htmlname.'").attr("data-pbqpercent", ui.item.discount);
|
||||
';
|
||||
}
|
||||
$script .= '
|
||||
@@ -217,6 +210,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
console.log("Make action update on each ui.item.update")
|
||||
// loop on each "update" fields
|
||||
$.each(ui.item.update, function(key, value) {
|
||||
console.log("Set value "+value+" into #"+key);
|
||||
$("#" + key).val(value).trigger("change");
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user