dolibarr.deliveryinvoiceadd.../README.md
data 632dc0d177 v1.3: E-Mail-Platzhalter, Fallback-Tags für Vorname/Nachname
- Alle Platzhalter auch als __KEY__-Format für E-Mail-Vorlagen
- billing_or_thirdparty_firstname/name mit Kundenname-Fallback
- Dokumentation aktualisiert

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:37:50 +01:00

147 lines
5.2 KiB
Markdown
Executable file

# DeliveryInvoiceAddress
Dolibarr-Modul zur Verwendung von Rechnungs-, Liefer- und Serviceadressen in ODT-Vorlagen und E-Mail-Templates.
## Funktionen
- Separate Rechnungsadresse in Angeboten, Aufträgen und Rechnungen
- Lieferadresse für Versanddokumente
- Serviceadresse für Servicedokumente
- Automatische Erkennung des Dokumenttyps (Angebot/Auftrag/Rechnung)
- CUSTOMER-Kontakt als Fallback für BILLING bei Angeboten/Aufträgen
- Fallback-Platzhalter: Rechnungskontakt oder automatisch Kundenname
## 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 Platzhalter
Alle Platzhalter sind in zwei Formaten verfügbar:
- **ODT-Vorlagen**: `{key}` (z.B. `{billing_contact_fullname}`)
- **E-Mail-Vorlagen**: `__KEY__` (z.B. `__BILLING_CONTACT_FULLNAME__`)
### Rechnungsadresse (Billing)
| ODT-Tag | E-Mail-Tag | Beschreibung |
|---------|------------|--------------|
| `{billing_contact_firstname}` | `__BILLING_CONTACT_FIRSTNAME__` | Vorname |
| `{billing_contact_name}` | `__BILLING_CONTACT_NAME__` | Nachname |
| `{billing_contact_fullname}` | `__BILLING_CONTACT_FULLNAME__` | Vorname + Nachname |
| `{billing_contact_address}` | `__BILLING_CONTACT_ADDRESS__` | Straße und Hausnummer |
| `{billing_contact_zip}` | `__BILLING_CONTACT_ZIP__` | Postleitzahl |
| `{billing_contact_town}` | `__BILLING_CONTACT_TOWN__` | Ort |
| `{billing_contact_country}` | `__BILLING_CONTACT_COUNTRY__` | Land |
### Lieferadresse (Delivery/Shipping)
| ODT-Tag | E-Mail-Tag | Beschreibung |
|---------|------------|--------------|
| `{delivery_contact_firstname}` | `__DELIVERY_CONTACT_FIRSTNAME__` | Vorname |
| `{delivery_contact_name}` | `__DELIVERY_CONTACT_NAME__` | Nachname |
| `{delivery_contact_fullname}` | `__DELIVERY_CONTACT_FULLNAME__` | Vorname + Nachname |
| `{delivery_contact_address}` | `__DELIVERY_CONTACT_ADDRESS__` | Straße und Hausnummer |
| `{delivery_contact_zip}` | `__DELIVERY_CONTACT_ZIP__` | Postleitzahl |
| `{delivery_contact_town}` | `__DELIVERY_CONTACT_TOWN__` | Ort |
| `{delivery_contact_country}` | `__DELIVERY_CONTACT_COUNTRY__` | Land |
### Serviceadresse (Service)
| ODT-Tag | E-Mail-Tag | Beschreibung |
|---------|------------|--------------|
| `{service_contact_firstname}` | `__SERVICE_CONTACT_FIRSTNAME__` | Vorname |
| `{service_contact_name}` | `__SERVICE_CONTACT_NAME__` | Nachname |
| `{service_contact_fullname}` | `__SERVICE_CONTACT_FULLNAME__` | Vorname + Nachname |
| `{service_contact_address}` | `__SERVICE_CONTACT_ADDRESS__` | Straße und Hausnummer |
| `{service_contact_zip}` | `__SERVICE_CONTACT_ZIP__` | Postleitzahl |
| `{service_contact_town}` | `__SERVICE_CONTACT_TOWN__` | Ort |
| `{service_contact_country}` | `__SERVICE_CONTACT_COUNTRY__` | Land |
### Fallback-Platzhalter (Rechnungskontakt ODER Kundenname)
Zeigt den Rechnungskontakt an, wenn zugeordnet. Sonst automatisch den Kundennamen.
| ODT-Tag | E-Mail-Tag | Beschreibung |
|---------|------------|--------------|
| `{billing_or_thirdparty}` | `__BILLING_OR_THIRDPARTY__` | Fullname oder Kundenname |
| `{billing_or_thirdparty_firstname}` | `__BILLING_OR_THIRDPARTY_FIRSTNAME__` | Vorname (leer bei Fallback) |
| `{billing_or_thirdparty_name}` | `__BILLING_OR_THIRDPARTY_NAME__` | Nachname oder Kundenname |
## Verwendung in ODT-Vorlagen
### Beispiel: Automatischer Fallback (empfohlen)
```
{billing_or_thirdparty}
{billing_contact_address}
{billing_contact_zip} {billing_contact_town}
```
### Beispiel: 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}
```
## Verwendung in E-Mail-Vorlagen
```
Sehr geehrte/r __BILLING_OR_THIRDPARTY__,
anbei erhalten Sie Ihre Rechnung __REF__.
```
## 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_*`
## Technische Details
### Datenbankstruktur
| Tabelle | Beschreibung |
|---------|--------------|
| `llx_element_contact` | Verknüpfung Dokument ↔ Kontakt |
| `llx_c_type_contact` | Kontakttyp-Definitionen |
| `llx_socpeople` | Kontaktdaten |
| `llx_c_country` | Länderbezeichnung |
### 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.3
- **Dolibarr:** 15.0+
- **PHP:** 7.1+