Changeset View
Changeset View
Standalone View
Standalone View
src/app/Documents/Receipt.php
Show First 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | class Receipt | ||||
* Prepare customer data for the template | * Prepare customer data for the template | ||||
* | * | ||||
* @return array Customer data for the template | * @return array Customer data for the template | ||||
*/ | */ | ||||
protected function customerData(): array | protected function customerData(): array | ||||
{ | { | ||||
$user = $this->wallet->owner; | $user = $this->wallet->owner; | ||||
$name = $user->name(); | $name = $user->name(); | ||||
$organization = $user->getSetting('organization'); | $settings = $user->getSettings(['organization', 'billing_address']); | ||||
$address = $user->getSetting('billing_address'); | |||||
$customer = trim(($organization ?: $name) . "\n$address"); | $customer = trim(($settings['organization'] ?: $name) . "\n" . $settings['billing_address']); | ||||
$customer = str_replace("\n", '<br>', htmlentities($customer)); | $customer = str_replace("\n", '<br>', htmlentities($customer)); | ||||
return [ | return [ | ||||
'id' => $this->wallet->owner->id, | 'id' => $this->wallet->owner->id, | ||||
'wallet_id' => $this->wallet->id, | 'wallet_id' => $this->wallet->id, | ||||
'customer' => $customer, | 'customer' => $customer, | ||||
]; | ]; | ||||
} | } | ||||
Show All 35 Lines |