From 27f1e753a3f711066ddcbae3ac22c1416c9ef183 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 30 Jun 2022 14:29:18 +1000 Subject: [PATCH] Working on Swiss QR Codes --- app/DataMapper/CompanySettings.php | 3 +++ app/Models/Presenters/CompanyPresenter.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index 3ee028fe98f7..837855712de0 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -25,6 +25,8 @@ class CompanySettings extends BaseSettings /*Invoice*/ public $auto_archive_invoice = false; // @implemented + public $qr_iban = ''; + public $lock_invoices = 'off'; //off,when_sent,when_paid //@implemented public $enable_client_portal_tasks = false; //@ben to implement @@ -289,6 +291,7 @@ class CompanySettings extends BaseSettings public $auto_archive_invoice_cancelled = false; public static $casts = [ + 'qr_iban' => 'string', 'email_subject_purchase_order' => 'string', 'email_template_purchase_order' => 'string', 'require_purchase_order_signature' => 'bool', diff --git a/app/Models/Presenters/CompanyPresenter.php b/app/Models/Presenters/CompanyPresenter.php index 4f871a552231..600436d973ce 100644 --- a/app/Models/Presenters/CompanyPresenter.php +++ b/app/Models/Presenters/CompanyPresenter.php @@ -128,17 +128,17 @@ class CompanyPresenter extends EntityPresenter public function address1() { - return $this->settings->address1; + return $this->entity->settings->address1; } public function address2() { - return $this->settings->address2; + return $this->entity->settings->address2; } public function qr_iban() { - $qr_iban = Helpers::formatCustomFieldValue($this->custom_fields, 'qr_iban') + return $this->entity->getSetting('qr_iban'); } public function getSpcQrCode($client_currency, $invoice_number, $balance_due_raw, $user_iban)