Skip to content
Code-Schnipsel Gruppen Projekte
Commit 603e7d0d erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

refactor: invoice output mail -> better fallbacks for contact person placeholder

Übergeordneter 95367619
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -15,6 +15,7 @@
use QUI\ERP\Accounting\Invoice\Settings;
use QUI\ERP\Accounting\Payments\Methods\AdvancePayment\Payment as AdvancePayment;
use QUI\ERP\Accounting\Payments\Methods\Invoice\Payment as InvoicePayment;
use QUI\ERP\Customer\Utils as CustomerUtils;
/**
* Class OutputProvider
......@@ -311,7 +312,7 @@ public static function getMailBody($entityId)
/**
* @param $Invoice
* @param $Customer
* @param QUI\ERP\User $Customer
* @return array
*/
protected static function getInvoiceLocaleVar($Invoice, $Customer): array
......@@ -332,6 +333,15 @@ protected static function getInvoiceLocaleVar($Invoice, $Customer): array
// contact person
$contactPerson = $Invoice->getAttribute('contact_person');
if (empty($contactPerson)) {
// Fetch contact person from live user (if existing)
$ContactPersonAddress = CustomerUtils::getInstance()->getContactPersonAddress($Customer);
if ($ContactPersonAddress) {
$contactPerson = $ContactPersonAddress->getName();
}
}
if (empty($contactPerson)) {
$contactPerson = $user;
}
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren