Custom labels

Informations

Module name DOLYWM Product label print systme
Editor / Editeur DOLYWM
Download or buy page / Page achat ou téléchargement External module - www.dolistore.com
Status / Statut / Estado
Prerequisites / Prérequis

Dolibarr max version: See on Dolistore

Last update date / Date mise à jour fiche / Fecha última actualización 2026-02-10
Note / Nota


Component part of the DOLYWM – ECOSYSTEM project, this module allows you to define labels relating to products and then print them on thermal printers.

It allows you to configure different type of labels that can contain information:

– related to a product (code, description, supplier, batch, etc.)

– defined at the time of printing (e.g. the batch when printing a delivery note)

– derived from other archives (product master data, third-party providers, etc.)

In case of presence of multiple thermal printers inside the warehouse, each label type can be addressed to a specific printer, or the same label can be addressed to different printers for different users.

These labels can be:

  • printed extemporaneously when needed
  • printed automatically when orders are placed (customers and suppliers), supplier invoices are received and delivery notes are issue. In this case, a copy of the label will be printed for each individual product in the document.

It assumes the ability to generate labels in the various languages (ZPL, EPL, FGL, ESC / POS, EPCL, ….) ​​in which labels can be programmed. For this purpose, some printer suppliers provide programs (eg ZDesigner for Zebra printers) that can generate labels in a simple and intuitive way.

Usage

The setup and label definition phase is crucial for the use of the module, so it is best to carry out these operations carefully before proceeding with printing.

Manual printing of labels

To obtain manual printing, select the “Tools” item in the main menu and then the “Custom labels” item, the list of available labels is shown.

Upon selecting the desired label, a page will allow you to enter the necessary data and define the number of labels you want to print.


Printing of labels from document (Orders, Shipments, Invoicess)

If, during the setup phase, the label to be used in the specific document (orders, invoices, shipments, …) was selected, a new button will be proposed,

this will allow you to print the labels relating to the document itself.

Depending on the setting of the other parameter “Request for label date in DDT / Orders”, the page that allows you to modify or complete the label data before printing them will be displayed or not.

Module configuration

Settings

The following information must be entered:

Connector Used: Allows you to select the connector used.

Here you can select one of the two connectors described below, or, by leaving the field blank, use printer addressing via IP. This latter option requires greater technical expertise and likely requires the intervention of a systems engineer.

Label Printer Name or  IP Address: Contains:

  • the name of the “Print Type” in the case of using the “Webapp Hardware Bridge” (see later)
  • the network name or IP address assigned to the printer.
  • if the value is instead left blank (this is the case in which the PHP Socket extension has not been enabled  or printers cannot be reached with an IP address), the printing of each label is preceded by a printer selection window; it is understandable how having to confirm this page slows down the functionality of the module considerably, in this situation the correct functioning of the module is also not guaranteed with all thermal printers on the market.

It is therefore recommended, for optimal operation of the module, to connect the thermal printer via one of the two connectors.

Label used in  … (Expeditions/Invoices/Receptions/Orders)

For each of the documents for which labels can be generated, it allows you to define which, among the various defined labels, is used at the time of issuing the document .

Associating a document type with a particular label causes a button for printing labels to appear in the document form.

Using the Label Dispatcher

This is the simplest option if you have a Windows terminal on your local network that can see the printers you want to use.

This application can be downloaded from here and offers the following advantages over the first one:

  • Multiple label printers can be used
  • The same label can be redirected to a different printer for each user

The connector must be configured by entering the following two parameters:

Server URL: Contains the URL to point to the Dolibarr API (usually <mydolibarrURL>/htdocs/api/index.php)

Api Key: Contains the API key of one of the Dolibarr users with permissions to access the various documents

Using the Webapp Hardware Bridge connector

This is the option that allows you to address printers even in local Linux networks.

The Webapp Hardware Bridge connector application can be downloaded and installed on all clients using the module.

Its use, through a simple configuration procedure, allows to considerably simplify the addressing phase of the printers, and does not require any technical skills.

If you opt for this option, it will be sufficient to associate a “Printer Type” to the label printer in the connector setup window (as in the following image) and then indicate the same value in the Setting field “Label Printer Name or IP Address” (in the two images, the previous and the following one, the RETE value)

Custom labels definition (label structure)

As mentioned it is necessary, for each of the labels to be defined, to generate a text file in one of the standard languages ​​used by thermal printers (ZPL, EPL, FGL, ESC / POS, EPCL, ….), for this purpose the hardware manufacturers generally make label design programs available, in the absence of these it is necessary to manually define the label using the syntax of the specific language.

It is important in this phase to define the “placeholders” where you want the values ​​taken from the database to be entered, when the labels are printed.

These placeholders are identified by inserting the strings [param1], [param2], … [paramn] in the text of the label, these strings will be associated with the database fields when defining the label fields, an operation described in the following paragraph.

The figure illustrates a placeholder label generated by the ZDesigner program for Zebra printers.

ZDesigner tips As regards the generation of the file with the ZDesigner, to obtain the necessary text file, follow the path “File>>Print”, turn on the “Print to File” checkbox and press the [Print] button. The obtained file (.prn) must be sent to the module.

Not all fonts are converted into text by Zdesigner, some are transformed into images and therefore the module is not able to replace the content. It is therefore advisable to open the .prn file with a text editor and check the presence of the text of all the placeholders ([param1], [param2], .…). If the strings are not present, you need to change the font of the placeholders.

Custom labels definition (label’s fields)

The second phase required for the definition of the label is that which, as shown in the figure, allows you to:

  • associate the previously defined text file to the label
  • associate each of the previously defined placeholders with a label field.

For this purposeyou need to access the module setup and use the [Custom labels] tab.

From here, you can enter the list of label types you want to use, each label contains a set of general information and a set of information specific to each placeholder.

The general informations are:

Title Indicate here the title you want to assign to the specific label

Type Allows you to define the type of label to be printed, there are three types of labels:

. Third Parties To print, from the tools menu, information relating to a third party

. Products To print, from the tools menu, information relating to a product

. Advanced To print labels from various documents (offers, orders, invoices, …)

Content of the label From here you can upload the previously generated text file for the label (see previous paragraph)

For each placeholder the following information must be defined:

Position: It is the position that identifies the placeholder number as defined in the label text.

For example, by entering the value 2 here, the text [param2] of the label will be replaced with the value of the database field identified by the “Type” parameter (described below) itto)

Label: Contains a description of the field

Type; Allows you to define the specific database value that will be used to replace the placeholder. The associated list allows you to report one of the following values:

  • Text When the label is printed, it allows you to manually enter a text string that will be printed on the label. This field, together with the two that follow, makes no sense if the label must be automatically printed at the time of the order or DDT
  • Number When the label is printed, it allows you to manually enter a numerical value that will be printed on the label.
  • Date When the label is printed, it allows you to manually enter a date that will be printed on the label.
  • Product Code On the label, instead of the placeholder, the code of the selected product will be printed.
  • Product Description The product description will be printed instead of the placeholder.
  • Product Barcode The product barcode is printed.
  • Third Party Code The third party code is printed.
  • Batch The batch of the product is printed.
  • Batch expiration date The expiration date for the batchis printed.
  • Third Party The company name of the third party is printed
  • Quantity Contains the quantity of products indicated in the document. If this particular type is present on the label, only one label will be printed showing the quantity, otherwise n (n = quantity of the document products) different labels will be printed
  • Custom fieldsIt allows you to manage the printing of other fields, these fields are defined through functions that can be created in the file “customlabels/lib/customlabels.lib.php” This file contains examples for creating functions

For example, having defined the placeholder [param2] in the text of the label, and having defined a label item as shown in the following figure, this placeholder will bereplaced, when the label is printed, with the description of the product