From 060f7bf67ceabd6fb58ffd55c850978c7148f532 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Nov 2022 15:37:59 +0100 Subject: [PATCH 1/3] Fix bad td balance --- htdocs/product/stock/card.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 02797fdbb37..74469967195 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -783,6 +783,7 @@ if ($action == 'create') { print $langs->trans("CorrectStock"); print ""; } + if (!empty($conf->global->PRODUCT_USE_UNITS)) { if ($i == 0) { $units = $productstatic->fk_unit; @@ -790,11 +791,13 @@ if ($action == 'create') { $sameunits = false; } } + print ""; $i++; } $db->free($resql); + // Total print ''.$langs->trans("Total").''; print ''; $valtoshow = price2num($totalunit, 'MS'); @@ -812,9 +815,15 @@ if ($action == 'create') { print ' '; print ''.price(price2num($totalvaluesell, 'MT')).''; } - print ' '; - print ' '; - print ' '; + + if ($user->rights->stock->mouvement->creer) { + print ' '; + } + + if ($user->rights->stock->creer) { + print ' '; + } + print ''; } else { dol_print_error($db); From 54c657e50c6456983199ba9d2490ece6c2f5e5a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Nov 2022 15:39:31 +0100 Subject: [PATCH 2/3] Fix negative reception was no more possible. Use hidden const to restore --- htdocs/reception/card.php | 1 + htdocs/reception/class/reception.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 97d56d56e09..2ee780f2e0d 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -359,6 +359,7 @@ if (empty($reshook)) { $batch = "batch".$i; $cost_price = "cost_price".$i; + //if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && getDolGlobalString('RECEPTION_GETS_ALL_ORDER_PRODUCTS')) || (GETPOST($qty, 'int') < 0 && getDolGlobalString('RECEPTION_ALLOW_NEGATIVE_QTY'))) { if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) { $ent = "entl".$i; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index e3434a9a298..2735d1b8006 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -583,7 +583,7 @@ class Reception extends CommonObject $qty = $obj->qty; - if ($qty <= 0) { + if ($qty == 0 || ($qty < 0 && !getDolGlobalInt('RECEPTION_ALLOW_NEGATIVE_QTY'))) { continue; } dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); From f038cca39ed303872ba18c463ad433f00a3b6518 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Nov 2022 22:47:56 +0100 Subject: [PATCH 3/3] FIX Autosearch on takepos was broken --- htdocs/takepos/index.php | 9 ++++++--- htdocs/takepos/invoice.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 2dda7872743..57b36045870 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -581,8 +581,9 @@ function New() { /** * Search products * - * @param {int} keyCodeForEnter Key code for "enter" - * return {void} + * @param string keyCodeForEnter Key code for "enter" or '' if not + * @param int moreorless ?? + * return void */ function Search2(keyCodeForEnter, moreorless) { var eventKeyCode = window.event.keyCode; @@ -597,6 +598,8 @@ function Search2(keyCodeForEnter, moreorless) { search_start = $('#search_start_'+moreorless).val(); } + console.log("search_term="+search_term); + if (search_term == '') { $("[id^=prowatermark]").html(""); $("[id^=prodesc]").text(""); @@ -610,7 +613,7 @@ function Search2(keyCodeForEnter, moreorless) { } var search = false; - if (keyCodeForEnter != '' || eventKeyCode == keyCodeForEnter) { + if (keyCodeForEnter == '' || eventKeyCode == keyCodeForEnter) { search = true; } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 0ba87cce069..0494bf604d5 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1655,7 +1655,7 @@ if (($action == "valid" || $action == "history") && $invoice->type != Facture::T if ($action == "search") { print '
- +
'; }