This commit is contained in:
David Bomba 2023-10-18 20:03:26 +11:00
parent bde9f60aee
commit 3ae1d3e694
4 changed files with 17 additions and 7 deletions

View File

@ -1 +1 @@
5.7.30 5.7.31

View File

@ -50,7 +50,8 @@ class EpcQrGenerator
); );
$writer = new Writer($renderer); $writer = new Writer($renderer);
$this->validateFields(); if($this->validateFields())
return '';
$qr = $writer->writeString($this->encodeMessage(), 'utf-8'); $qr = $writer->writeString($this->encodeMessage(), 'utf-8');
@ -87,12 +88,16 @@ class EpcQrGenerator
private function validateFields() private function validateFields()
{ {
if (Ninja::isSelfHost() && isset($this->company?->custom_fields?->company2)) { 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'); 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)) { if (Ninja::isSelfHost() && isset($this->company?->custom_fields?->company1)) {
return true;
nlog('The IBAN field is required'); nlog('The IBAN field is required');
} }
return false;
} }
private function formatMoney($value) private function formatMoney($value)

View File

@ -174,9 +174,14 @@ class SwissQrGenerator
return $html; return $html;
} catch (\Exception $e) { } catch (\Exception $e) {
foreach ($qrBill->getViolations() as $key => $violation) {
nlog("qr"); if(is_iterable($qrBill->getViolations())) {
nlog($violation);
foreach ($qrBill->getViolations() as $key => $violation) {
nlog("qr");
nlog($violation);
}
} }
nlog($e->getMessage()); nlog($e->getMessage());

View File

@ -15,8 +15,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => env('APP_VERSION','5.7.30'), 'app_version' => env('APP_VERSION','5.7.31'),
'app_tag' => env('APP_TAG','5.7.30'), 'app_tag' => env('APP_TAG','5.7.31'),
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),