diff --git a/ChangeLog.md b/ChangeLog.md index 9b6f5cc..0fede8e 100755 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -27,6 +27,18 @@ - **Kompakterer Scan-Button**: Mehr Platz für Tool-Buttons - **Service Worker v5.3**: Aktualisiertes Caching mit JsBarcode-Library +## 5.2 + +### Bestellzeilen-Bearbeitung +- **Edit-Button**: Stift-Icon an jeder Bestellzeile für zuverlässiges Öffnen des Bearbeitungsdialogs +- **Touch-Kompatibilität**: Button funktioniert zuverlässig auf allen Touch-Geräten +- **Dialog vereinfacht**: Abbrechen-Button entfernt, nur noch Löschen und Speichern +- **Typ-Fix**: Status-Vergleich für Entwurfs-Erkennung korrigiert + +### Caching +- **Cache-Busting**: CSS/JS URLs mit Versionsparameter für zuverlässige PWA-Updates +- **Service Worker v6.0**: Optimiertes Caching-Verhalten + ## 5.1 ### Bestellungen verwalten diff --git a/ajax/getorderlines.php b/ajax/getorderlines.php index cc14753..9ae186a 100755 --- a/ajax/getorderlines.php +++ b/ajax/getorderlines.php @@ -98,7 +98,7 @@ echo json_encode([ 'id' => $order->id, 'ref' => $order->ref, 'ref_supplier' => $order->ref_supplier, - 'status' => $order->statut, + 'status' => (int) $order->statut, 'supplier_name' => $order->thirdparty->name ?? '', 'total_ht' => (float) $order->total_ht ], diff --git a/core/modules/modHandyBarcodeScanner.class.php b/core/modules/modHandyBarcodeScanner.class.php index 1a2e675..7eb8d93 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.4'; + $this->version = '6.0'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; diff --git a/css/scanner.css b/css/scanner.css index 6db0583..f29b646 100755 --- a/css/scanner.css +++ b/css/scanner.css @@ -1075,16 +1075,10 @@ border: 1px solid var(--colorborder, #2b2c2e); border-radius: 6px; margin-bottom: 8px; - cursor: pointer; transition: all 0.2s ease; color: var(--colortext, #dcdcdc); } -.order-line:hover { - background: var(--colorbacktitle, #3b3c3e); - border-color: var(--butactionbg, #ad8c4f); -} - .order-line-info { flex: 1; min-width: 0; @@ -1112,6 +1106,29 @@ white-space: nowrap; } +.order-line-edit-btn { + background: transparent; + border: none; + padding: 8px; + margin-left: 8px; + cursor: pointer; + color: var(--colortextmuted, #888); + border-radius: 6px; + transition: all 0.2s; +} + +.order-line-edit-btn:hover, +.order-line-edit-btn:active { + background: var(--colorbacktitle, #3b3c3e); + color: var(--butactionbg, #0077b3); +} + +.order-line-edit-btn svg { + width: 18px; + height: 18px; + display: block; +} + /* Line edit dialog */ .line-edit-dialog { position: fixed; diff --git a/js/scanner.js b/js/scanner.js index 1fb3c1c..b81b7cf 100755 --- a/js/scanner.js +++ b/js/scanner.js @@ -1184,30 +1184,32 @@ return; } - const canEdit = order.status === 0; + const canEdit = order.status == 0; content.innerHTML = lines.map(line => ` -
+
${escapeHtml(line.product_label)}
${line.product_ref ? 'Ref: ' + escapeHtml(line.product_ref) : ''} ${line.is_freetext ? '(Freitext)' : (line.stock > 0 ? '| Lager: ' + line.stock : '')}
${line.qty}x
+ ${canEdit ? `` : ''}
`).join(''); - if (canEdit) { - content.querySelectorAll('.order-line').forEach(lineEl => { - lineEl.addEventListener('click', function() { - const lineId = parseInt(this.dataset.lineId); - const oId = parseInt(this.dataset.orderId); - const line = currentModalLines.find(l => l.id === lineId); - if (line) { - showLineEditDialogInModal(line, oId); - } - }); + // Edit-Button Events + content.querySelectorAll('.order-line-edit-btn').forEach(btn => { + btn.addEventListener('click', function(e) { + e.stopPropagation(); + const lineId = parseInt(this.dataset.lineId); + const line = currentModalLines.find(l => l.id === lineId); + if (line) { + showLineEditDialogInModal(line, orderId); + } }); - } + }); } function showLineEditDialogInModal(line, orderId) { @@ -1237,7 +1239,6 @@
-
@@ -1249,8 +1250,6 @@ resumeScanner(); } - document.getElementById('line-cancel').addEventListener('click', closeDialog); - document.getElementById('line-save').addEventListener('click', () => { const newQty = parseFloat(document.getElementById('line-qty-input').value) || 1; const descInput = document.getElementById('line-desc-input'); @@ -1483,7 +1482,7 @@ return; } - const canEdit = order.status === 0; // Only draft orders can be edited + const canEdit = order.status == 0; // Only draft orders can be edited content.innerHTML = lines.map(line => `
@@ -1537,7 +1536,6 @@
-
@@ -1549,8 +1547,6 @@ resumeScanner(); } - document.getElementById('line-cancel').addEventListener('click', closeDialog); - document.getElementById('line-save').addEventListener('click', () => { const newQty = parseFloat(document.getElementById('line-qty-input').value) || 1; const descInput = document.getElementById('line-desc-input'); diff --git a/pwa.php b/pwa.php index 51a79fb..216053a 100755 --- a/pwa.php +++ b/pwa.php @@ -53,7 +53,7 @@ $colormain = getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#0077b3'); Barcode Scanner - +