diff --git a/README.md b/README.md index c495636..7023f50 100755 --- a/README.md +++ b/README.md @@ -6,18 +6,30 @@ Erweitert Rechnungen, Angebote und Kundenaufträge um **Sections**, **Textzeilen ## 🔑 ODT Template Schlüsselwörter -Diese Variablen stehen in ODT-Templates zur Verfügung: +### Zeilen-Variablen (pro Zeile in row.lines) | Variable | Wert | Beschreibung | |----------|------|--------------| -| `{line_is_section}` | 1/0 | Zeile ist eine Section (Überschrift) | -| `{line_is_textline}` | 1/0 | Zeile ist eine Textzeile | -| `{line_is_subtotal}` | 1/0 | Zeile ist eine Zwischensumme | -| `{line_is_product}` | 1/0 | Zeile ist ein Produkt (inkl. Sections/Text/Subtotals) | -| `{line_is_normal}` | 1/0 | Zeile ist ein normales Produkt (KEIN Section/Text/Subtotal) | -| `{line_is_special}` | 1/0 | Zeile ist Section, Text ODER Subtotal | +| `{line_is_section}` | 1/"" | Zeile ist eine Section (Überschrift) | +| `{line_is_textline}` | 1/"" | Zeile ist eine Textzeile | +| `{line_is_subtotal}` | 1/"" | Zeile ist eine Zwischensumme | +| `{line_is_product}` | 1/"" | Zeile ist ein Produkt mit Produktreferenz | +| `{line_is_free_line}` | 1/"" | Zeile ist eine freie Zeile (ohne Produktreferenz) | +| `{line_is_normal}` | 1/"" | Zeile ist normal (special_code = 0) | +| `{line_is_special}` | 1/"" | Zeile ist Section, Text ODER Subtotal | | `{line_special_code}` | 0-102 | special_code Wert der Zeile | +### Globale Variablen (für das gesamte Dokument) + +| Variable | Wert | Beschreibung | +|----------|------|--------------| +| `{object_has_sections}` | 1/"" | Dokument enthält mindestens eine Section | +| `{object_has_textlines}` | 1/"" | Dokument enthält mindestens eine Textzeile | +| `{object_has_speciallines}` | 1/"" | Dokument enthält Sections, Textzeilen oder Subtotals | +| `{object_count_sections}` | Zahl | Anzahl der Sections im Dokument | +| `{object_count_textlines}` | Zahl | Anzahl der Textzeilen im Dokument | +| `{object_count_subtotals}` | Zahl | Anzahl der Zwischensummen im Dokument | + ### special_code Werte | Typ | special_code | @@ -30,6 +42,10 @@ Diese Variablen stehen in ODT-Templates zur Verfügung: ### ODT Template Beispiel ``` +[!-- IF {object_has_sections} --] +Dieses Dokument enthält {object_count_sections} Section(s). +[!-- ENDIF {object_has_sections} --] + [!-- BEGIN row.lines --] [!-- IF {line_is_section} --] @@ -42,9 +58,13 @@ Diese Variablen stehen in ODT-Templates zur Verfügung: {line_desc} [!-- ENDIF {line_is_textline} --] -[!-- IF {line_is_normal} --] +[!-- IF {line_is_product} --] +{line_pos} {line_qty} {line_ref} {line_desc} {line_up_locale} € {line_price_ht_locale} € +[!-- ENDIF {line_is_product} --] + +[!-- IF {line_is_free_line} --] {line_pos} {line_qty} {line_desc} {line_up_locale} € {line_price_ht_locale} € -[!-- ENDIF {line_is_normal} --] +[!-- ENDIF {line_is_free_line} --] [!-- IF {line_is_subtotal} --] ───────────────────────────────────────