1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Template previews

This commit is contained in:
David Bomba 2023-11-16 15:57:24 +11:00
parent fb27bd99e5
commit a8eee34623
2 changed files with 8 additions and 5 deletions

View File

@ -62,7 +62,7 @@ class TemplateAction implements ShouldQueue
private string $template,
private string $entity,
private int $user_id,
private Company $company,
public Company $company,
private string $db,
private string $hash,
private bool $send_email = false
@ -109,9 +109,12 @@ class TemplateAction implements ShouldQueue
$data[$key] = $result;
}
$ts = $template_service->build($data);
// nlog($ts->getHtml());
$ts = $template_service
->setCompany($this->company)
->build($data);
nlog($ts->getHtml());
if($this->send_email) {
$pdf = $ts->getPdf();

View File

@ -214,7 +214,7 @@ class TemplateService
{
$this->data = $this->preProcessDataBlocks($data);
nlog($this->data);
return $this;
}
@ -596,7 +596,7 @@ class TemplateService
'balance_raw' => ($payment->amount - $payment->refunded - $payment->applied),
'date' => $this->translateDate($payment->date, $payment->client->date_format(), $payment->client->locale()),
'method' => $payment->translatedType(),
'currency' => $payment->currency->code,
'currency' => $payment->currency->code ?? $this->company->currency()->code,
'exchange_rate' => $payment->exchange_rate,
'transaction_reference' => $payment->transaction_reference,
'is_manual' => $payment->is_manual,