1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #8105 from Hobby-Student/v5-develop

fix SEPA QR Code recurring invoice
This commit is contained in:
David Bomba 2023-01-03 20:03:49 +11:00 committed by GitHub
commit 62d997cdf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@ namespace App\Helpers\Epc;
use App\Models\Company;
use App\Models\Invoice;
use App\Models\RecurringInvoice;
use App\Utils\Ninja;
use BaconQrCode\Renderer\ImageRenderer;
use BaconQrCode\Renderer\Image\SvgImageBackEnd;
@ -35,7 +36,7 @@ class EpcQrGenerator
];
public function __construct(protected Company $company, protected Invoice $invoice, protected float $amount){}
public function __construct(protected Company $company, protected Invoice|RecurringInvoice $invoice, protected float $amount){}
public function getQrCode()
{

View File

@ -596,7 +596,7 @@ class HtmlEngine
$data['$payments'] = ['value' => $payment_list, 'label' => ctrans('texts.payments')];
}
if($this->entity_string == 'invoice' && isset($this->company?->custom_fields?->company1))
if(($this->entity_string == 'invoice' || $this->entity_string == 'recurring_invoice') && isset($this->company?->custom_fields?->company1))
{
$data['$sepa_qr_code'] = ['value' => (new EpcQrGenerator($this->company, $this->entity,$data['$amount_raw']['value']))->getQrCode(), 'label' => ''];
}