mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01: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(),
|
||||
isset($this->company?->custom_fields?->company1) ? $this->company->settings->custom_value1 : '',
|
||||
$this->formatMoney($this->amount),
|
||||
$this->sepa['purpose'],
|
||||
$this->getPurposeCode(),
|
||||
substr($this->invoice->number, 0, 34),
|
||||
'',
|
||||
' '
|
||||
]), "\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()
|
||||
{
|
||||
if (Ninja::isSelfHost() && isset($this->company?->custom_fields?->company2)) {
|
||||
|
Loading…
Reference in New Issue
Block a user