From 707d7f50a01748ebe23296bb8559fd540569c226 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 25 Feb 2026 13:57:03 +0100 Subject: [PATCH] fix: Freitext-Zeilen im Modal klickbar machen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lines-Array wird jetzt gecacht für Click-Handler. Freitext-Zeilen zeigen '(Freitext)' statt Lagerbestand. Co-Authored-By: Claude Opus 4.5 --- core/modules/modHandyBarcodeScanner.class.php | 2 +- js/scanner.js | 12 +++++++++--- sw.js | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/modules/modHandyBarcodeScanner.class.php b/core/modules/modHandyBarcodeScanner.class.php index 1683b5e..1a2e675 100755 --- a/core/modules/modHandyBarcodeScanner.class.php +++ b/core/modules/modHandyBarcodeScanner.class.php @@ -76,7 +76,7 @@ class modHandyBarcodeScanner extends DolibarrModules $this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@handybarcodescanner' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z' - $this->version = '5.3'; + $this->version = '5.4'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; diff --git a/js/scanner.js b/js/scanner.js index e51bcd5..1fb3c1c 100755 --- a/js/scanner.js +++ b/js/scanner.js @@ -1169,10 +1169,16 @@ }); } + // Cache für aktuelle Bestellzeilen (Modal) + let currentModalLines = []; + function renderOrderLinesInModal(lines, order, orderId) { const content = document.getElementById('orders-modal-detail-content'); if (!content) return; + // Lines cachen für Click-Handler + currentModalLines = lines; + if (lines.length === 0) { content.innerHTML = '
Keine Positionen
'; return; @@ -1181,10 +1187,10 @@ const canEdit = order.status === 0; content.innerHTML = lines.map(line => ` -
+
${escapeHtml(line.product_label)}
-
${line.product_ref ? 'Ref: ' + escapeHtml(line.product_ref) : ''} ${line.stock > 0 ? '| Lager: ' + line.stock : ''}
+
${line.product_ref ? 'Ref: ' + escapeHtml(line.product_ref) : ''} ${line.is_freetext ? '(Freitext)' : (line.stock > 0 ? '| Lager: ' + line.stock : '')}
${line.qty}x
@@ -1195,7 +1201,7 @@ lineEl.addEventListener('click', function() { const lineId = parseInt(this.dataset.lineId); const oId = parseInt(this.dataset.orderId); - const line = lines.find(l => l.id === lineId); + const line = currentModalLines.find(l => l.id === lineId); if (line) { showLineEditDialogInModal(line, oId); } diff --git a/sw.js b/sw.js index c509abe..1541c78 100755 --- a/sw.js +++ b/sw.js @@ -1,5 +1,5 @@ // Service Worker for HandyBarcodeScanner PWA -const CACHE_NAME = 'scanner-v5.4'; +const CACHE_NAME = 'scanner-v5.5'; const ASSETS = [ 'pwa.php', 'css/scanner.css',