From 3ae1d3e694da8dc143a28ff25ac893350a0b26ed Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 18 Oct 2023 20:03:26 +1100 Subject: [PATCH] v5.7.31 --- VERSION.txt | 2 +- app/Helpers/Epc/EpcQrGenerator.php | 7 ++++++- app/Helpers/SwissQr/SwissQrGenerator.php | 11 ++++++++--- config/ninja.php | 4 ++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 25285daaef52..557bab7d4518 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.7.30 \ No newline at end of file +5.7.31 \ No newline at end of file diff --git a/app/Helpers/Epc/EpcQrGenerator.php b/app/Helpers/Epc/EpcQrGenerator.php index 62d61a0a15bb..342c5f775f06 100644 --- a/app/Helpers/Epc/EpcQrGenerator.php +++ b/app/Helpers/Epc/EpcQrGenerator.php @@ -50,7 +50,8 @@ class EpcQrGenerator ); $writer = new Writer($renderer); - $this->validateFields(); + if($this->validateFields()) + return ''; $qr = $writer->writeString($this->encodeMessage(), 'utf-8'); @@ -87,12 +88,16 @@ class EpcQrGenerator private function validateFields() { if (Ninja::isSelfHost() && isset($this->company?->custom_fields?->company2)) { + return true; nlog('The BIC field is not present and _may_ be a required fields for EPC QR codes'); } if (Ninja::isSelfHost() && isset($this->company?->custom_fields?->company1)) { + return true; nlog('The IBAN field is required'); } + + return false; } private function formatMoney($value) diff --git a/app/Helpers/SwissQr/SwissQrGenerator.php b/app/Helpers/SwissQr/SwissQrGenerator.php index abacbb57c056..d8c1ad77304c 100644 --- a/app/Helpers/SwissQr/SwissQrGenerator.php +++ b/app/Helpers/SwissQr/SwissQrGenerator.php @@ -174,9 +174,14 @@ class SwissQrGenerator return $html; } catch (\Exception $e) { - foreach ($qrBill->getViolations() as $key => $violation) { - nlog("qr"); - nlog($violation); + + if(is_iterable($qrBill->getViolations())) { + + foreach ($qrBill->getViolations() as $key => $violation) { + nlog("qr"); + nlog($violation); + } + } nlog($e->getMessage()); diff --git a/config/ninja.php b/config/ninja.php index 7ef548ab7efa..df657179e40b 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -15,8 +15,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION','5.7.30'), - 'app_tag' => env('APP_TAG','5.7.30'), + 'app_version' => env('APP_VERSION','5.7.31'), + 'app_tag' => env('APP_TAG','5.7.31'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),