mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 17:44:32 -04:00
Add purpose code if available
This commit is contained in:
parent
a212c04ace
commit
f7fb20a7ec
@ -82,13 +82,22 @@ class EpcQrGenerator
|
|||||||
$this->company->present()->name(),
|
$this->company->present()->name(),
|
||||||
isset($this->company?->custom_fields?->company1) ? $this->company->settings->custom_value1 : '',
|
isset($this->company?->custom_fields?->company1) ? $this->company->settings->custom_value1 : '',
|
||||||
$this->formatMoney($this->amount),
|
$this->formatMoney($this->amount),
|
||||||
$this->sepa['purpose'],
|
$this->getPurposeCode(),
|
||||||
substr($this->invoice->number, 0, 34),
|
substr($this->invoice->number, 0, 34),
|
||||||
'',
|
'',
|
||||||
' '
|
' '
|
||||||
]), "\n");
|
]), "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getPurposeCode(): string
|
||||||
|
{
|
||||||
|
if(isset($this->invoice->client->id_number) && strlen($this->invoice->client->id_number) > 2)
|
||||||
|
return $this->invoice->client->id_number;
|
||||||
|
|
||||||
|
return $this->sepa['purpose'];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private function validateFields()
|
private function validateFields()
|
||||||
{
|
{
|
||||||
if (Ninja::isSelfHost() && isset($this->company?->custom_fields?->company2)) {
|
if (Ninja::isSelfHost() && isset($this->company?->custom_fields?->company2)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user