de:cobi.wms:etikettenvorlagen
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| de:cobi.wms:etikettenvorlagen [2025/10/24 10:52] – Translation page created thuth | de:cobi.wms:etikettenvorlagen [2025/10/24 11:08] (current) – [JavaScript-Integration] thuth | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Etikettenvorlagen ====== | ====== Etikettenvorlagen ====== | ||
| + | Etikettenvorlagen (Label Templates) für COBI.wms sind HTML-Dateien, | ||
| + | Diese Platzhalter werden über eine einfache „Suchen-und-Ersetzen“-Logik durch die jeweiligen Werte ersetzt, | ||
| + | bevor das resultierende HTML zur grafischen Darstellung an das Android-System übergeben wird. | ||
| + | |||
| + | ===== Unterstützte Platzhalterwerte ===== | ||
| + | |||
| + | Die folgenden Abschnitte beschreiben die verschiedenen Arten von Platzhaltern, | ||
| + | |||
| + | ==== Einfache Platzhalter ==== | ||
| + | |||
| + | Die Platzhalter müssen innerhalb des HTML-Dokuments im folgenden Format verwendet werden: | ||
| + | '' | ||
| + | |||
| + | ^ Dokumentebene ^^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | ^ Geschäftspartner des Belegs ^^ | ||
| + | | '' | ||
| + | | '' | ||
| + | ^ Positionsebene ^^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | ^ Bezogen auf Mengeneinheit der Position ^^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | ^ Artikelebene ^^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | || | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | ^ Chargenebene ^^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | ^ Seriennummernebene ^^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | ^ Lagerebene ^^ | ||
| + | | '' | ||
| + | | '' | ||
| + | ^ Lagerplatzebene ^^ | ||
| + | | '' | ||
| + | | '' | ||
| + | ^ Kontextabhängig ^^ | ||
| + | | '' | ||
| + | |||
| + | Platzhalter auf Dokument- und Positionsebene sind nur gültig, | ||
| + | wenn das Etikett aus einer Belegposition heraus gedruckt wird. | ||
| + | |||
| + | Die '' | ||
| + | dass die Barcode-Länge dem jeweiligen GTIN-Standard entspricht, | ||
| + | oder setzen ggf. **Nullen ein**, um weiterhin ein gültiges Format zu erzeugen. | ||
| + | |||
| + | ==== Artikelpreise ==== | ||
| + | |||
| + | Preise können über den Platzhalter | ||
| + | '' | ||
| + | aus Preislisten ausgegeben werden. | ||
| + | |||
| + | Format-Beispiele: | ||
| + | |||
| + | * '' | ||
| + | |||
| + | Weitere Varianten: | ||
| + | |||
| + | ^ Platzhalter | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | ==== Barcodegrafiken ==== | ||
| + | |||
| + | Spezial-Platzhalter zur Anzeige tatsächlicher Barcodes: | ||
| + | |||
| + | < | ||
| + | @barcode(FORMAT, | ||
| + | </ | ||
| + | |||
| + | Unterstützte FORMATE: | ||
| + | |||
| + | * CODEBAR | ||
| + | * CODE_39 / CODE_93 / CODE_128 | ||
| + | * DATA_MATRIX | ||
| + | * EAN_8 / EAN_13 | ||
| + | * QR_CODE | ||
| + | * UPC_A / UPC_E | ||
| + | |||
| + | Beispiel: | ||
| + | |||
| + | < | ||
| + | @barcode(EAN_13, | ||
| + | </ | ||
| + | |||
| + | === GS1-Unterstützung === | ||
| + | |||
| + | GS1-Barcodes erfordern als ersten Charakter: | ||
| + | **'' | ||
| + | |||
| + | Beispiel: | ||
| + | |||
| + | < | ||
| + | @barcode(CODE_128, | ||
| + | </ | ||
| + | |||
| + | ==== Präzisere HTML-Kontrolle ==== | ||
| + | |||
| + | Alternativ: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ==== Benutzer-Eingaben ==== | ||
| + | |||
| + | Eingabeplatzhalter: | ||
| + | |||
| + | < | ||
| + | @input(NAME)@ | ||
| + | </ | ||
| + | |||
| + | Mit Anzeigename: | ||
| + | |||
| + | < | ||
| + | @input(quantity[Anzahl Kisten])@ | ||
| + | </ | ||
| + | |||
| + | Mit Auswahlwerten: | ||
| + | |||
| + | < | ||
| + | @input(Currency; | ||
| + | </ | ||
| + | |||
| + | ==== Datums-Platzhalter ==== | ||
| + | |||
| + | < | ||
| + | @date(FORMAT)@ | ||
| + | </ | ||
| + | |||
| + | Beispiele: | ||
| + | |||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | ==== Datums-Umformatierung ==== | ||
| + | |||
| + | Der spezielle Platzhalter zur Datumsumformatierung kann verwendet werden, um ein Datum in einem bestimmten Format einzulesen und anschließend in einem anderen Format auszugeben. Die Verwendung sieht wie folgt aus: | ||
| + | |||
| + | < | ||
| + | @dateReformat(DATUM|VON_FORMAT|ZU_FORMAT)@ | ||
| + | </ | ||
| + | |||
| + | **HINWEIS: | ||
| + | |||
| + | Dieser Platzhalter verwendet das senkrechte Strichsymbol '' | ||
| + | |||
| + | Die Funktionsweise ist wie folgt: | ||
| + | Der Text, der im Parameter '' | ||
| + | |||
| + | Die Parameter '' | ||
| + | |||
| + | Im folgenden Beispiel wird das Ablaufdatum einer Charge in einem benutzerdefinierten Format ausgegeben — unter Ausnutzung der Tatsache, dass der Platzhalter '' | ||
| + | |||
| + | Beispiel: | ||
| + | |||
| + | < | ||
| + | @dateReformat(@batchExpiryGS1@|yyMMdd|dd.MM.yyyy)@ | ||
| + | </ | ||
| + | |||
| + | ===== JavaScript-Integration ===== | ||
| + | |||
| + | Das HTML-Dokument, | ||
| + | |||
| + | < | ||
| + | @useJavaScript@ | ||
| + | </ | ||
| + | |||
| + | **HINWEIS: | ||
| + | |||
| + | Während der Ausführung des JavaScript-Codes steht das spezielle Objekt '' | ||
| + | |||
| + | < | ||
| + | cobiwms.get(name) | ||
| + | </ | ||
| + | |||
| + | Der Parameter '' | ||
| + | Beispiel: Ein Aufruf von '' | ||
| + | |||
| + | (Man könnte zwar auch Platzhalter wie '' | ||
| + | |||
| + | < | ||
| + | cobiwms.prompt(title, | ||
| + | </ | ||
| + | |||
| + | Durch den Aufruf dieser Funktion zeigt die App ein Popup mit einem Eingabefeld für den Benutzer an. | ||
| + | Der Parameter '' | ||
| + | Der Parameter '' | ||
| + | Diese Funktion wird nach Bestätigung der Eingabe aufgerufen und erhält dabei einen Parameter, | ||
| + | der den vom Benutzer eingegebenen Wert als String enthält. | ||
| + | |||
| + | |||
| + | Zugriff auf Platzhalterwerte: | ||
| + | |||
| + | < | ||
| + | window.handleCurrency = function (currency) { | ||
| + | ... | ||
| + | } | ||
| + | |||
| + | cobiwms.prompt(" | ||
| + | </ | ||
| + | |||
| + | ===== Beispielvorlagen ===== | ||
| + | |||
| + | Zwei vollständige Beispiel-HTML-Dateien: | ||
| + | |||
| + | ==== Datei 1 ==== | ||
| + | |||
| + | Einfaches Etikett mit Barcode, Preis & Zeitstempel. | ||
| + | |||
| + | <code html> | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <meta charset=" | ||
| + | < | ||
| + | @page { | ||
| + | /* You can use width/ | ||
| + | /* For example, the following two are equivalent: */ | ||
| + | /* size: 148mm 105mm; */ | ||
| + | /* size: A6 landscape; */ | ||
| + | size: A6 landscape; | ||
| + | |||
| + | /* Don't change, use the container padding below. */ | ||
| + | margin: 0; | ||
| + | padding: 0; | ||
| + | } | ||
| + | |||
| + | body { | ||
| + | /* We could use 100vw/100vh to cover the whole size declared with @page, but this doesn' | ||
| + | work with ZPL printing, so repeat the page dimensions explicitly. | ||
| + | use standardized sizes like A6 here. The height should be minimally reduced to make | ||
| + | sure the HTML renderer doesn' | ||
| + | width: 148mm; | ||
| + | height: 104mm; | ||
| + | |||
| + | /* Don't change, use the container below. */ | ||
| + | margin: 0; | ||
| + | padding: 0; | ||
| + | |||
| + | /* Useful to diagnose dimension issues. */ | ||
| + | outline: 0.5mm solid black; | ||
| + | outline-offset: | ||
| + | } | ||
| + | |||
| + | .container { | ||
| + | /* Don't change. */ | ||
| + | box-sizing: border-box; | ||
| + | position: relative; | ||
| + | width: 100%; | ||
| + | height: 100%; | ||
| + | |||
| + | font-family: | ||
| + | font-size: 18pt; | ||
| + | |||
| + | /* Global padding from the edges. */ | ||
| + | padding: 3mm; | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | <div class=" | ||
| + | |||
| + | <div style=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <div style=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <div style=" | ||
| + | @itemName@ | ||
| + | </ | ||
| + | <div style=" | ||
| + | @barcode(CODE_128, | ||
| + | </ | ||
| + | <div style=" | ||
| + | (90)@itemCode@(10)@batchNumber@ | ||
| + | </ | ||
| + | |||
| + | <div style=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <div style=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Datei 2 ==== | ||
| + | |||
| + | Beispiel mit Benutzereingaben & JavaScript. | ||
| + | |||
| + | <code html> | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <meta charset=" | ||
| + | < | ||
| + | @page { | ||
| + | /* You can use width/ | ||
| + | /* For example, the following two are equivalent: */ | ||
| + | /* size: 148mm 105mm; */ | ||
| + | /* size: A6 landscape; */ | ||
| + | size: A6 landscape; | ||
| + | |||
| + | /* Don't change, use the container padding below. */ | ||
| + | margin: 0; | ||
| + | padding: 0; | ||
| + | } | ||
| + | |||
| + | body { | ||
| + | /* We could use 100vw/100vh to cover the whole size declared with @page, but this doesn' | ||
| + | work with ZPL printing, so repeat the page dimensions explicitly. | ||
| + | use standardized sizes like A6 here. The height should be minimally reduced to make | ||
| + | sure the HTML renderer doesn' | ||
| + | width: 148mm; | ||
| + | height: 104mm; | ||
| + | |||
| + | /* Don't change, use the container below. */ | ||
| + | margin: 0; | ||
| + | padding: 0; | ||
| + | |||
| + | /* Useful to diagnose dimension issues. */ | ||
| + | outline: 0.5mm solid black; | ||
| + | outline-offset: | ||
| + | } | ||
| + | |||
| + | .container { | ||
| + | /* Don't change. */ | ||
| + | box-sizing: border-box; | ||
| + | position: relative; | ||
| + | width: 100%; | ||
| + | height: 100%; | ||
| + | |||
| + | font-family: | ||
| + | font-size: 18pt; | ||
| + | |||
| + | /* Global padding from the edges. */ | ||
| + | padding: 3mm; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | <!-- Input definitions: | ||
| + | @input(text[Insert value])@ | ||
| + | @input(selection[Select value]; | ||
| + | @input(codeFormat[Barcode type]; | ||
| + | --> | ||
| + | |||
| + | < | ||
| + | // @useJavaScript@ | ||
| + | window.onload = function() { | ||
| + | var insert = document.getElementById(' | ||
| + | insert.textContent = "Hello World!" | ||
| + | cobiwms.print() | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | <div class=" | ||
| + | |||
| + | <div style=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <div style=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <div style=" | ||
| + | @itemName@ | ||
| + | </ | ||
| + | <div style=" | ||
| + | @barcode(@input(codeFormat)@, | ||
| + | </ | ||
| + | <div style=" | ||
| + | (90)@itemCode@(10)@batchNumber@ | ||
| + | </ | ||
| + | |||
| + | <div style=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <div style=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
de/cobi.wms/etikettenvorlagen.1761295947.txt.gz · Last modified: by thuth