> For the complete documentation index, see [llms.txt](https://helpcenter.etron.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpcenter.etron.info/onretail-wiki/handbuch/drucker-and-hardware/etikettendruck-onretail/bsp-etikette-aus-erechnung-mit-stattpreis-und-if-abfrage.md). Agents can also search and read this documentation through its [MCP server](https://helpcenter.etron.info/~gitbook/mcp).

# Bsp. Etiketten aus Beleg mit Stattpreis, Mengen und IF Abfrage

Sonderpreis, Streichpreis

Etiketten können mit der richtigen Konfiguration auch von Belegen aus gedruckt werden.\
Der Vorteil liegt hier darin, dass Etiketten verschiedener Artikel auf einen Schlag angedruckt werden können, und die Mengen der Belegpositionen als Etikettenmengen vorgeschlagen werden.\
\
Es ist möglich einen Stattpreis anzudrucken, aber nur für den Fall, dass ein Stattpreis definiert ist und dass dieser höher ist als der Verkaufspreis.

Stattpreise für Produkte festlegen: [Stattpreis](https://helpcenter.etron.info/onretail-wiki/handbuch/verwaltungsoberflache/stammdaten/produkte/konfiguration/preislisten/stattpreis.md)\
\
Bedingungen in der Etikettendefinition werden über `if` und `endif` Blöcke angegeben.

![](https://2354692687-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MSZ7ac6RT4RTvH1fVzP%2F-Mhr_xizsQ3vDHbrD0HC%2F-Mhrasd9Oe7eCS3t946X%2FScreen%20Shot%202021-08-24%20at%2012.01.23.png?alt=media\&token=def7bbfa-8cc9-4aa6-8b21-3a2491ff71d7)

```
{#- ==================   DEFINITIONEN   ===================== #} 
{%- set PRINTER_NAME = json.dumps(template.printer_name) %}
{%- set LABEL_TYPE = json.dumps("Rechnung") %}
{%- set invoice = model %}
{%- set GROUP_NAME = json.dumps(invoice.name) %}

{%- set LABEL_QUANTITY = 1 %}
{%- set TAX_INFO = model.taxes_id and json.dumps(model.taxes_id[0].name|replace("Mehrwertsteuer ", "MwSt: ")) or '"keine MwSt"' %}
{%- set VARIANT_ATTRIBUTES %}
 {%- for attr in model.attribute_value_ids|sort(attribute="attribute_id.name",reverse=true) %}
   {%- if loop.index > 1 %}, {% endif %}
     {{- attr.attribute_id.name| truncate(2,end="")}}: {{attr.name}}
 {%- endfor %}
{%- endset %}
{%- set VARIANT_ATTRIBUTES = json.dumps(VARIANT_ATTRIBUTES) %}
{%- set LIST_PRICE = model.lst_price or 0 %}
{%- set LABEL_REF_NAME = json.dumps(model.name) %}
{%- set PRODUCT_NAME = json.dumps(model.name) %}
{%- set PRODUCT_EAN = json.dumps(model.product_code) %}
{%- set PRODUCT_PLU = json.dumps(model.id) %}
{%- set GENERAL_PRICELIST_PRICE = model.general_pricelist_price or model.lst_price or 0 %}
{%- set INT_REF =  json.dumps(model.default_code) %}
{%- set HS_CODE =  model.hs_code %}
{%- set MANUFACTURER_CODE =  model.default_code %}

{#- =======================   Angepasstes Etikett   ======================= #}
{%- set FDS -%}
ID;ETT01;3;Benutzerdefiniertes Etikett
         ; ID ; OPT ; TEXT               ; FORM ; FORM SIZE
FormAsgn ; Z  ; 0   ; Benutzerdefiniert  ; 99   ; Benutzerdefiniert
Head ; FORM99 ; 40x24 ; Preis Rechts

   ; Artikeltext
   Font  ; 8.Arial Bold
   Field ; 1.5 ; 2 ; 0 ; TEXT1
   Text ; 2.5 ; 2 ; 0 ; {{ VARIANT_ATTRIBUTES }}

   ; Strichcode
   Font   ; 36.EAN-13B Half Height
   Field ; 9 ; 2 ; 0 ; EANFCD ; FONTBOX{108,70}

   ; Stattpreis (Durchgestrichener Preis, optional)
{%- if LIST_PRICE > GENERAL_PRICELIST_PRICE %}
   Font ; 9.Arial  
   If ; IsStp
      FIELD ; 13 ; 48 ; 0 ; STPW ; SAYRIGHT
      Line ; 16 ; 35 ; 16 ; 49 ; 3
   End
{% endif %}
   
   ; Preis
   Font ; 9.Arial 
   Field ; 16 ; 35 ; 0 ; LDWSYM
   Field ; 16 ; 48 ; 0 ; VKP ; SAYRIGHT
   
   ;HS Code
{%- if HS_CODE %}
   Font ; 9.Arial 
   Text ; 15 ; 2 ; 0 ; {{ HS_CODE }}
{% endif %}

    ; Hersteller Nummer 
{%- if MANUFACTURER_CODE %}
   Font ; 9.Arial
   Text ; 19 ; 2 ; 0 ; {{ MANUFACTURER_CODE }}
{% endif %}
   
{%- endset %}
{%- set FDSDATA = json.dumps(FDS) -%}
  
{#- =======================   LABEL DRUCKER DATEN   ======================= #}
{
  "Quantity": {{ LABEL_QUANTITY }},
  "FormName": {{ LABEL_REF_NAME }},
  "FormDesc": {{ VARIANT_ATTRIBUTES }},
  "GroupName": {{ GROUP_NAME }},
  "LabelType": {{ LABEL_TYPE }},
  "LabelPrinterData": {
    "CmdVer": 1,
    "Cmd": "PrintLabel",
    "PrinterSettings": {
       "PrinterName": {{ PRINTER_NAME }}
    },
    "Layout": {
      "Style": 99,
      "RowCount": 30,
      "ColCount": 1,
      "StartRow": 2,
      "StartCol": 0
    },
    "PrintData": [{
      "Ean": {{ PRODUCT_EAN }},
      "Plu": {{ PRODUCT_PLU }},
      "Text": {{ PRODUCT_NAME }},
      "Text2": {{ VARIANT_ATTRIBUTES }},
      "Price": {{ GENERAL_PRICELIST_PRICE }},
      "CrossedPrice": {{ LIST_PRICE }},
      "ShowPrice": true,
      "VatPrice": true,
      "VatRate": {{ TAX_INFO }},
      "GpiTmg": 200,
      "GpiMeh": "ML",
      "GpiBas": 1000
    }],"FdsData":{{FDSDATA}} 
  }
}

{#- =======================   LABEL DRUCKER DATEN ENDE   ======================= #}    
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://helpcenter.etron.info/onretail-wiki/handbuch/drucker-and-hardware/etikettendruck-onretail/bsp-etikette-aus-erechnung-mit-stattpreis-und-if-abfrage.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
