bind title and subheading to the respective document

This commit is contained in:
Hendrik Hagendorn
2023-01-19 20:23:15 +01:00
parent d9d342f9d4
commit 12ca46381a
7 changed files with 111 additions and 38 deletions

View File

@ -172,7 +172,7 @@ abstract class Template extends Component
$this->hideDueAt = $hideDueAt;
$this->textDocumentTitle = $this->getTextDocumentTitle($type, $textDocumentTitle);
$this->textDocumentSubheading = $this->gettextDocumentSubheading($type, $textDocumentSubheading);
$this->textDocumentSubheading = $this->getTextDocumentSubheading($type, $textDocumentSubheading);
$this->textContactInfo = $this->getTextContactInfo($type, $textContactInfo);
$this->showContactRoute = $this->getShowContactRoute($type, $showContactRoute);
$this->textIssuedAt = $this->getTextIssuedAt($type, $textIssuedAt);
@ -193,7 +193,7 @@ abstract class Template extends Component
$this->textQuantity = $this->getTextQuantity($type, $textQuantity);
$this->textPrice = $this->getTextPrice($type, $textPrice);
$this->textAmount = $this->getTextAmount($type, $textAmount);
$this->print = $this->getPrint($print);
// Set Parent data
@ -295,6 +295,10 @@ abstract class Template extends Component
return $textDocumentTitle;
}
if (! empty($this->document) && $this->document->title !== '') {
return $this->document->title;
}
$key = $this->getSettingKey($type, 'title');
if (! empty(setting($key))) {
@ -316,6 +320,10 @@ abstract class Template extends Component
return $textDocumentSubheading;
}
if (! empty($this->document) && $this->document->subheading !== '') {
return $this->document->subheading;
}
$key = $this->getSettingKey($type, 'subheading');
if (! empty(setting($key))) {