Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-05-10 11:51:52 +02:00
commit 80fd3666df
2 changed files with 24 additions and 1 deletions

View File

@ -592,6 +592,18 @@ function Search2(keyCodeForEnter, moreorless) {
search_start = $('#search_start_'+moreorless).val();
}
if (search_term == '') {
$("[id^=prowatermark]").html("");
$("[id^=prodesc]").text("");
$("[id^=probutton]").text("");
$("[id^=probutton]").hide();
$("[id^=proprice]").attr("class", "hidden");
$("[id^=proprice]").html("");
$("[id^=proimg]").attr("src", "genimg/empty.png");
$("[id^=prodiv]").data("rowid", "");
return;
}
var search = false;
var eventKeyCode = window.event.keyCode;
if (keyCodeForEnter == '' || eventKeyCode == keyCodeForEnter) {
@ -613,6 +625,7 @@ function Search2(keyCodeForEnter, moreorless) {
$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&term=' + search_term + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) {
for (i = 0; i < <?php echo $MAXPRODUCT ?>; i++) {
if (typeof (data[i]) == "undefined") {
$("#prowatermark" + i).html("");
$("#prodesc" + i).text("");
$("#probutton" + i).text("");
$("#probutton" + i).hide();

View File

@ -558,7 +558,17 @@ if (empty($reshook)) {
}
if ($idoflineadded <= 0) {
$invoice->fetch_thirdparty();
$idoflineadded = $invoice->addline($prod->description, $price, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', null, '', '', 0, 100, '', null, 0);
$array_options = array();
// complete line by hook
$parameters = array('prod' => $prod);
$reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action);
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) {
$idoflineadded = $invoice->addline($prod->description, $price, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', null, '', '', $array_options, 100, '', null, 0);
}
if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) {
$CUSTOMER_DISPLAY_line1 = $prod->label;
$CUSTOMER_DISPLAY_line2 = price($price_ttc);