From 2a3ef464933e93fdeeec68da04788f104d2492d9 Mon Sep 17 00:00:00 2001 From: Hobby-Student <6012744+Hobby-Student@users.noreply.github.com> Date: Tue, 3 Jan 2023 09:41:20 +0100 Subject: [PATCH] fix SEPA QR Code recurring invoice --- app/Helpers/Epc/EpcQrGenerator.php | 3 ++- app/Utils/HtmlEngine.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Helpers/Epc/EpcQrGenerator.php b/app/Helpers/Epc/EpcQrGenerator.php index 1bfbff2f956b..b608466f352b 100644 --- a/app/Helpers/Epc/EpcQrGenerator.php +++ b/app/Helpers/Epc/EpcQrGenerator.php @@ -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() { diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index f1958ef62195..d663dd0dfa5e 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -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' => '']; }