Working on QR Codes

This commit is contained in:
David Bomba 2022-06-30 22:48:16 +10:00
parent 716561e22b
commit 90805ca46b
2 changed files with 19 additions and 1 deletions

View File

@ -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'];

View File

@ -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) => {