# DeliveryInvoiceAddress Dolibarr-Modul zur Verwendung von Rechnungs-, Liefer- und Serviceadressen in ODT-Vorlagen. ## Funktionen - Separate Rechnungsadresse in Angeboten, Aufträgen und Rechnungen - Lieferadresse für Versanddokumente - Serviceadresse für Servicedokumente - Automatische Erkennung des Dokumenttyps (Angebot/Auftrag/Rechnung) - Fallback auf Kundenadresse wenn kein spezieller Kontakt vorhanden ## Installation 1. Modul-Ordner nach `htdocs/custom/deliveryinvoiceaddress/` kopieren 2. In Dolibarr: Home → Setup → Modules → DeliveryInvoiceAddress aktivieren ## Unterstützte Dokumenttypen | Dokumenttyp | Element | Kontakttypen | |-------------|---------|--------------| | Angebot (Propal) | `propal` | BILLING, CUSTOMER | | Auftrag (Commande) | `commande` | BILLING, CUSTOMER, SERVICE, SHIPPING | | Rechnung (Facture) | `facture` | BILLING, SERVICE, SHIPPING | ## Verfügbare ODT-Tags ### Rechnungsadresse (Billing) | Tag | Beschreibung | |-----|--------------| | `{billing_contact_firstname}` | Vorname | | `{billing_contact_name}` | Vorname (Fallback: Nachname) | | `{billing_contact_address}` | Straße und Hausnummer | | `{billing_contact_zip}` | Postleitzahl | | `{billing_contact_town}` | Ort | | `{billing_contact_country}` | Land | ### Lieferadresse (Delivery/Shipping) | Tag | Beschreibung | |-----|--------------| | `{delivery_contact_firstname}` | Vorname | | `{delivery_contact_name}` | Vorname (Fallback: Nachname) | | `{delivery_contact_address}` | Straße und Hausnummer | | `{delivery_contact_zip}` | Postleitzahl | | `{delivery_contact_town}` | Ort | | `{delivery_contact_country}` | Land | ### Serviceadresse (Service) | Tag | Beschreibung | |-----|--------------| | `{service_contact_firstname}` | Vorname | | `{service_contact_name}` | Vorname (Fallback: 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: Rechnungsadresse mit Fallback auf Kundenadresse ``` [!-- IF {billing_contact_name} --] {billing_contact_name} {billing_contact_address} {billing_contact_zip} {billing_contact_town} [!-- ELSE {billing_contact_name} --] {company_name} {company_address} {company_zip} {company_town} [!-- ENDIF {billing_contact_name} --] ``` ### Beispiel: Zwei Adressen nebeneinander ``` Rechnungsadresse: Lieferadresse: {billing_contact_name} {delivery_contact_name} {billing_contact_address} {delivery_contact_address} {billing_contact_zip} {billing_contact_town} {delivery_contact_zip} {delivery_contact_town} ``` ## Kontakte zuordnen 1. Öffne das Dokument (Angebot/Auftrag/Rechnung) 2. Gehe zum Tab "Kontakte/Adressen" 3. Füge einen Kontakt hinzu und wähle die entsprechende Rolle: - **Kundenkontakt für Rechnungen** (BILLING) → `billing_contact_*` - **Kundenkontakt für Lieferung** (SHIPPING) → `delivery_contact_*` - **Kundenkontakt für Service** (SERVICE) → `service_contact_*` ## Debugging Bei Problemen Log-Level auf DEBUG setzen: 1. Home → Setup → Logs → Syslog aktivieren 2. Dokument generieren 3. Log prüfen (z.B. `dolibarr.log`) Relevante Log-Einträge beginnen mit: `DeliveryInvoiceAddress:` ## Technische Details ### Datenbankstruktur | Tabelle | Beschreibung | |---------|--------------| | `llx_element_contact` | Verknüpfung Dokument ↔ Kontakt | | `llx_c_type_contact` | Kontakttyp-Definitionen | | `llx_socpeople` | Kontaktdaten | ### Hauptfunktion ``` deliveryinvoiceaddress_completesubstitutionarray() ``` Datei: `core/substitutions/functions_deliveryinvoiceaddress.lib.php` ## Autor Eduard Wisch - DATA IT Solution https://data-it-solution.de ## Lizenz GPL v3 oder höher ## Version - **Version:** 1.2 - **Dolibarr:** 15.0+ - **PHP:** 7.1+