Fixed OAID replacer when no wohneinheit_id in preorder

This commit is contained in:
Frank Schubert
2023-01-27 13:49:59 +01:00
parent eab73f53e3
commit 917eb29cb0

View File

@@ -120,7 +120,7 @@ class Preordernotification extends mfBaseModel {
'FIRMA' => $preorder->company,
'FIRMA_ODER_NAME' => ($preorder->company) ? $preorder->company : $fullname,
'EMAIL' => $preorder->email,
'ANSCHLUSS_OAID' => $preorder->adb_wohneinheit->oaid,
'ANSCHLUSS_OAID' => ($preorder->adb_wohneinheit_id) ? $preorder->adb_wohneinheit->oaid : $preorder->adb_hausnummer->oaid,
'ANSCHLUSS_STRASSE' => $preorder->adb_hausnummer->strasse->name,
'ANSCHLUSS_HAUSNUMMER' => $preorder->adb_hausnummer->hausnummer,
'ANSCHLUSS_PLZ' => $preorder->adb_hausnummer->plz->plz,