diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index ef690786508..093aac417d4 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -60,10 +60,11 @@ class FormOther * Return HTML code for scanner tool. * This must be called into an existing
* - * @param string $jstoexecuteonadd Name of javascript function to call + * @param string $jstoexecuteonadd Name of javascript function to call + * @param string $mode 'all' (both product and lot barcode) or 'product' (product barcode only) or 'lot' (lot number only) * @return string HTML component */ - public function getHTMLScannerForm($jstoexecuteonadd = 'barcodescannerjs') + public function getHTMLScannerForm($jstoexecuteonadd = 'barcodescannerjs', $mode = 'all') { global $langs; @@ -73,10 +74,15 @@ class FormOther $out .= '
'; $out .= '
Barcode scanner tool...

'; - $out .= '
'; - $out .= '
'; - $out .= '
'; - + if ($mode == 'product') { + $out .= ''; + } elseif ($mode == 'lot') { + $out .= ''; + } else { // $mode = 'all' + $out .= '
'; + $out .= '
'; + $out .= '
'; + } $stringaddbarcode = $langs->trans("QtyToAddAfterBarcodeScan", "tmphtml"); $htmltoreplaceby = ''; $stringaddbarcode = str_replace("tmphtml", $htmltoreplaceby, $stringaddbarcode); diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 658a521fcc1..9e99312ce69 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -807,7 +807,7 @@ if ($object->id > 0) { } include DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $formother = new FormOther($db); - print $formother->getHTMLScannerForm("barcodescannerjs"); + print $formother->getHTMLScannerForm("barcodescannerjs", 'all'); } //Call method to undo changes in real qty