Fix secondary fonts for Invoice Design preview

If a secondary font is used in the Invoice Design settings, it works in
the Custom Design editor, but the preview in General Settings always
shows Roboto in place of the secondary font, regardless of settings.

This updates PdfMock to also support secondary fonts on the main tab.
This commit is contained in:
Dave Shoreman 2024-04-24 15:12:03 +01:00
parent 3b5bf28aad
commit 9bad0873e9
No known key found for this signature in database
GPG Key ID: C920D1D63709F443

View File

@ -242,6 +242,7 @@ class PdfMock
'$company.postal_code' => $this->settings->postal_code, '$company.postal_code' => $this->settings->postal_code,
'$client.billing_city' => 'Aufderharchester', '$client.billing_city' => 'Aufderharchester',
'$secondary_font_name' => isset($this->settings?->secondary_font) ? $this->settings->secondary_font : 'Roboto', '$secondary_font_name' => isset($this->settings?->secondary_font) ? $this->settings->secondary_font : 'Roboto',
'$secondary_font_url' => isset($this->settings?->secondary_font) ? \App\Utils\Helpers::resolveFont($this->settings->secondary_font)['url'] : 'https://fonts.googleapis.com/css2?family=Roboto&display=swap',
'$product.line_total' => '', '$product.line_total' => '',
'$product.tax_amount' => '', '$product.tax_amount' => '',
'$company.vat_number' => $this->settings->vat_number, '$company.vat_number' => $this->settings->vat_number,
@ -249,7 +250,6 @@ class PdfMock
'$quote.quote_number' => '0029', '$quote.quote_number' => '0029',
'$client.postal_code' => '11243', '$client.postal_code' => '11243',
'$contact.first_name' => 'Benedict', '$contact.first_name' => 'Benedict',
'$secondary_font_url' => 'https://fonts.googleapis.com/css2?family=Roboto&display=swap',
'$contact.signature' => '', '$contact.signature' => '',
'$company_logo_size' => $this->settings->company_logo_size ?: '65%', '$company_logo_size' => $this->settings->company_logo_size ?: '65%',
'$product.tax_rate1' => ctrans('texts.tax'), '$product.tax_rate1' => ctrans('texts.tax'),