From 90805ca46b6a789e20d2388128f0634ba9a3ccf0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 30 Jun 2022 22:48:16 +1000 Subject: [PATCH] Working on QR Codes --- app/Services/PdfMaker/Design.php | 18 ++++++++++++++++++ resources/views/pdf-designs/clean.html | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 01be541aa1c0..a1e7beaaae2b 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -173,9 +173,27 @@ class Design extends BaseDesign $this->sharedFooterElements(), ], ], + // 'swiss-qr' => [ + // 'id' => 'swiss-qr', + // 'elements' => $this->swissQrCodeElement(), + // ] ]; } + + public function swissQrCodeElement() :array + { + if($this->type == self::DELIVERY_NOTE) + return []; + + $elements = []; + + if(strlen($this->company->getSetting('qr_iban')) > 5 && strlen($this->company->getSetting('besr_id')) > 1) + $elements[] = ['element' => 'qr_code', 'content' => '$swiss_qr', 'show_empty' => false, 'properties' => ['data-ref' => 'swiss-qr-code']]; + + return $elements; + } + public function companyDetails(): array { $variables = $this->context['pdf_variables']['company_details']; diff --git a/resources/views/pdf-designs/clean.html b/resources/views/pdf-designs/clean.html index 706129159743..9230bf86aa44 100644 --- a/resources/views/pdf-designs/clean.html +++ b/resources/views/pdf-designs/clean.html @@ -341,7 +341,7 @@ $entity_images 'product-table', 'task-table', 'delivery-note-table', 'statement-invoice-table', 'statement-payment-table', 'statement-aging-table-totals', 'statement-invoice-table-totals', 'statement-payment-table-totals', 'statement-aging-table', - 'client-details','vendor-details' + 'client-details','vendor-details', 'swiss-qr' ]; tables.forEach((tableIdentifier) => {