# Delivery Invoice Address Module Dolibarr-Modul zur Anzeige von Rechnungs-, Liefer- und Serviceadressen in ODT-Vorlagen. ## Installation 1. Modul-Ordner nach `htdocs/custom/deliveryinvoiceaddress/` kopieren 2. In Dolibarr: Home → Setup → Modules → DeliveryInvoiceAddress aktivieren ## Verfügbare ODT-Tags ### Rechnungsadresse (Billing Address) Kontakt mit Rolle "BILLING" (Rechnungsadresse) - `{billing_contact_firstname}` - Vorname - `{billing_contact_name}` - Nachname - `{billing_contact_fullname}` - Vorname + Nachname (berücksichtigt `MAIN_FIRSTNAME_NAME_POSITION`) - `{billing_contact_address}` - Straße und Hausnummer - `{billing_contact_zip}` - Postleitzahl - `{billing_contact_town}` - Ort - `{billing_contact_country}` - Land ### Lieferadresse (Delivery/Shipping Address) Kontakt mit Rolle "SHIPPING" (Lieferadresse) - `{delivery_contact_firstname}` - Vorname - `{delivery_contact_name}` - Nachname - `{delivery_contact_fullname}` - Vorname + Nachname - `{delivery_contact_address}` - Straße und Hausnummer - `{delivery_contact_zip}` - Postleitzahl - `{delivery_contact_town}` - Ort - `{delivery_contact_country}` - Land ### Serviceadresse (Service Address) Kontakt mit Rolle "SERVICE" (Serviceadresse) - `{service_contact_firstname}` - Vorname - `{service_contact_name}` - Nachname - `{service_contact_fullname}` - Vorname + Nachname - `{service_contact_address}` - Straße und Hausnummer - `{service_contact_zip}` - Postleitzahl - `{service_contact_town}` - Ort - `{service_contact_country}` - Land ## Verwendung in ODT-Vorlagen ### Beispiel 1: Voller Name ``` Rechnungsadresse: {billing_contact_fullname} {billing_contact_address} {billing_contact_zip} {billing_contact_town} ``` ### Beispiel 2: Vorname und Nachname getrennt ``` Rechnungsadresse: {billing_contact_firstname} {billing_contact_name} {billing_contact_address} {billing_contact_zip} {billing_contact_town} ``` ### Beispiel 3: Zwei Adressen nebeneinander ``` Rechnungsadresse: Lieferadresse: {billing_contact_fullname} {delivery_contact_fullname} {billing_contact_address} {delivery_contact_address} {billing_contact_zip} {billing_contact_town} {delivery_contact_zip} {delivery_contact_town} ``` ## Wichtige Hinweise - **Kontaktrollen**: Die Kontakte müssen die richtigen Rollen haben (BILLING, SHIPPING, SERVICE) - **Nur Rechnungen**: Das Modul funktioniert nur bei Rechnungen (`Facture`), nicht bei Angeboten oder Aufträgen - **Leere Felder**: Wenn kein Kontakt mit der entsprechenden Rolle zugeordnet ist, bleiben die Tags leer - **Mehrere Kontakte**: Pro Rolle wird nur der erste zugeordnete Kontakt verwendet - **Namensreihenfolge**: `{xxx_contact_fullname}` berücksichtigt die Dolibarr-Einstellung `MAIN_FIRSTNAME_NAME_POSITION` ## Technische Details ### Datenbankstruktur Das Modul liest Kontakte per JOIN aus folgenden Tabellen: - `llx_element_contact` - Verknüpfung Rechnung ↔ Kontakt - `llx_c_type_contact` - Kontakttyp-Definitionen (element = 'facture') - `llx_socpeople` - Kontaktdaten (firstname, lastname, address, etc.) - `llx_c_country` - Länderbezeichnung ### Code-Referenz Hauptfunktion: `deliveryinvoiceaddress_completesubstitutionarray()` Datei: `core/substitutions/functions_deliveryinvoiceaddress.lib.php` ## Lizenz GPL v3 oder höher ## Version Version: 1.2 Dolibarr-Kompatibilität: 19.0+