Skip to content

Commit

Permalink
Fix secondary fonts for Invoice Design preview
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dshoreman committed Apr 24, 2024
1 parent 3b5bf28 commit 9bad087
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/Services/Pdf/PdfMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function initEntity(): mixed
$entity->tax_map = $this->getTaxMap();
$entity->total_tax_map = $this->getTotalTaxMap();
$entity->invitation->company = $this->company;

return $entity;
}

Expand Down Expand Up @@ -242,14 +242,14 @@ public function getStubVariables(): array
'$company.postal_code' => $this->settings->postal_code,
'$client.billing_city' => 'Aufderharchester',
'$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.tax_amount' => '',
'$company.vat_number' => $this->settings->vat_number,
'$invoice.invoice_no' => '0029',
'$quote.quote_number' => '0029',
'$client.postal_code' => '11243',
'$contact.first_name' => 'Benedict',
'$secondary_font_url' => 'https://fonts.googleapis.com/css2?family=Roboto&display=swap',
'$contact.signature' => '',
'$company_logo_size' => $this->settings->company_logo_size ?: '65%',
'$product.tax_rate1' => ctrans('texts.tax'),
Expand Down Expand Up @@ -994,7 +994,7 @@ private function getVendorStubVariables()
<table align="center" cellspacing="0" cellpadding="0" style="width: 600px;">
<tr>
<td align="center" valign="top">
<![endif]-->
<![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" >
<tbody><tr>
<td align="center" class="new_button" style="border-radius: 2px; background-color: #298AAB">
Expand Down Expand Up @@ -1028,7 +1028,7 @@ private function getVendorStubVariables()
<table align="center" cellspacing="0" cellpadding="0" style="width: 600px;">
<tr>
<td align="center" valign="top">
<![endif]-->
<![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" >
<tbody><tr>
<td align="center" class="new_button" style="border-radius: 2px; background-color: #298AAB">
Expand Down Expand Up @@ -1059,7 +1059,7 @@ private function getVendorStubVariables()
<table align="center" cellspacing="0" cellpadding="0" style="width: 600px;">
<tr>
<td align="center" valign="top">
<![endif]-->
<![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" >
<tbody><tr>
<td align="center" class="new_button" style="border-radius: 2px; background-color: #298AAB">
Expand Down Expand Up @@ -1094,7 +1094,7 @@ private function getVendorStubVariables()
<table align="center" cellspacing="0" cellpadding="0" style="width: 600px;">
<tr>
<td align="center" valign="top">
<![endif]-->
<![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" >
<tbody><tr>
<td align="center" class="new_button" style="border-radius: 2px; background-color: #298AAB">
Expand Down

0 comments on commit 9bad087

Please sign in to comment.