Both sides previous revisionPrevious revisionNext revision | Previous revision |
cobi.wms:label_templates [2022/12/01 10:20] – tkammer | cobi.wms:label_templates [2023/06/19 13:59] (current) – tkammer |
---|
| ''serialLotNumber'' | Lot-number of serial number | | | ''serialLotNumber'' | Lot-number of serial number | |
| ''serialDetails'' | Serial details/notes | | | ''serialDetails'' | Serial details/notes | |
| ^ Warehouse-level ^^ |
| | ''warehouseCode'' | Warehouse code | |
| | ''warehouseName'' | Warehouse name | |
^ Bin location-level ^^ | ^ Bin location-level ^^ |
| ''locationCode'' | Bin location code | | | ''locationCode'' | Bin location code | |
</code> | </code> |
| |
In this example, the first GS1 barcode field is ''01'' which symbolizes that a GTIN-14 follows. By using the placeholder ''itemBarcodeGTIN14'' we ensure that exactly 14 digits are inserted here. This field does not need to be terminated with a pipe symbol, since it has a fixed length of 14 digits. | In this example, the first GS1 barcode field is ''01'' which symbolizes that a GTIN-14 follows. By using the placeholder ''itemBarcodeGTIN14'' we ensure that exactly 14 digits are inserted here. This field does not need to be terminated with a vertical bar symbol, since it has a fixed length of 14 digits. |
| |
The next field is ''10'' i.e. the batch number. This field is allowed to contain 1 to 20 digits or arbitrary characters. If we use batch numbers of 10 characters, this means we must end this GS1 field explicitly with a pipe symbol. | The next field is ''10'' i.e. the batch number. This field is allowed to contain 1 to 20 digits or arbitrary characters. If we use batch numbers of 10 characters, this means we must end this GS1 field explicitly with a vertical bar symbol. |
| |
Here's a list of commonly used GS1 field identifiers: | Here's a list of commonly used GS1 field identifiers: |
=== Better control of generated HTML === | === Better control of generated HTML === |
| |
The ''barcode()'' placeholder generates a whole ''<img ... />'' tag in the generated HTML. If you want closer control over the HTML, like adding additional attributes to the ''img'' tag, you can use the ''barcodeB64()'' placeholder instead, which produces a PNG in Base64. Example: | The ''barcode()'' placeholder generates a whole ''<img ... />'' tag in the generated HTML. If you want closer control over the HTML, like adding additional attributes to the ''img'' tag, you can use the ''barcodeSrc()'' or ''barcodeBase64()'' placeholders instead. |
| |
| The ''barcodeSrc'' placeholder generates only the contents of the ''src'' attribute. Example: |
| |
| <code> |
| <img id='...' class='...' src='@barcodeSrc(...)@' /> |
| </code> |
| |
| The ''barcodeBase64'' placeholder generates only the Base64 string. Example: |
| |
<code> | <code> |
<img id='...' class='...' src='data:image/png;base64,@barcodeB64(...)@' /> | <img id='...' class='...' src='data:image/png;base64,@barcodeBase64(...)@' /> |
</code> | </code> |
| |
The parameters of the ''barcodeB64()'' placeholder are exactly the same as that of the regular ''barcode()'' placeholder. That means you must still provide the ''WIDTH'' and ''HEIGHT'' parameters; these will be passed to the barcode generation system that produces the Base64 PNG. | The parameters of the ''barcodeSrc()'' and ''barcodeBase64()'' placeholders are exactly the same as that of the regular ''barcode()'' placeholder. That means you must still provide the ''WIDTH'' and ''HEIGHT'' parameters; these will be passed to the barcode generation system that produces the Base64 PNG. (This has no effect on the width and height of the ''img'' element in HTML/CSS.) |
| |
==== User-input values ==== | ==== User-input values ==== |
</code> | </code> |
| |
**NOTE:** Don't put any spaces before or after the parentheses or the separating pipe symbols. (The spaces would be considered part of the corresponding parameter.) | **NOTE:** Don't put any spaces before or after the parentheses or the separating vertical bar symbols. (The spaces would be considered part of the corresponding parameter.) |
| |
This placeholder uses the pipe symbol instead of commas to separate its parameters, because the parameters themselves may contain commas. | This placeholder uses the vertical bar symbol instead of commas to separate its parameters, because the parameters themselves may contain commas. |
| |
The mechanism is as follows: the text found within the ''DATE'' parameter is interpreted in accordance to the format specification ''FROM_FORMAT'' so the software knows what date/time it represents, and it's then turned into ''TO_FORMAT''. | The mechanism is as follows: the text found within the ''DATE'' parameter is interpreted in accordance to the format specification ''FROM_FORMAT'' so the software knows what date/time it represents, and it's then turned into ''TO_FORMAT''. |
sure the HTML renderer doesn't start a second page. */ | sure the HTML renderer doesn't start a second page. */ |
width: 148mm; | width: 148mm; |
height: 104.9mm; | height: 104mm; |
| |
/* Don't change, use the container below. */ | /* Don't change, use the container below. */ |
sure the HTML renderer doesn't start a second page. */ | sure the HTML renderer doesn't start a second page. */ |
width: 148mm; | width: 148mm; |
height: 104.9mm; | height: 104mm; |
| |
/* Don't change, use the container below. */ | /* Don't change, use the container below. */ |
} | } |
</style> | </style> |
| |
<!-- Input definitions: | <!-- Input definitions: |
| |
@input(text[Insert value])@ | @input(text[Insert value])@ |
@input(selection[Select value];Value 1,Value 2,Value 3)@ | @input(selection[Select value];Value 1,Value 2,Value 3)@ |
@input(codeFormat[Barcode type];CODE_128,DATA_MATRIX,QR_CODE)@ | @input(codeFormat[Barcode type];CODE_128,DATA_MATRIX,QR_CODE)@ |
| |
--> | --> |
| |
<!-- @useJavaScript@ --> | |
<script> | <script> |
| // @useJavaScript@ |
window.onload = function() { | window.onload = function() { |
var insert = document.getElementById('js-insert') | var insert = document.getElementById('js-insert') |
insert.textContent = "Hello World!" | insert.textContent = "Hello World!" |
window.cobiwms.print() | cobiwms.print() |
} | } |
</script> | </script> |