mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 05:34:30 -04:00
Fixes for template engine
This commit is contained in:
parent
0186368f39
commit
4c535a5be1
@ -59,6 +59,9 @@ class DesignFilters extends QueryFilters
|
|||||||
public function entities(string $entities = ''): Builder
|
public function entities(string $entities = ''): Builder
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(stripos($entities, 'statement') !== false)
|
||||||
|
$entities = 'client';
|
||||||
|
|
||||||
if (strlen($entities) == 0 || str_contains($entities, ',')) {
|
if (strlen($entities) == 0 || str_contains($entities, ',')) {
|
||||||
return $this->builder;
|
return $this->builder;
|
||||||
}
|
}
|
||||||
|
@ -162,6 +162,7 @@ class Statement
|
|||||||
$ts->addGlobal(['show_credits' => $this->options['show_credits_table']]);
|
$ts->addGlobal(['show_credits' => $this->options['show_credits_table']]);
|
||||||
$ts->addGlobal(['show_aging' => $this->options['show_aging_table']]);
|
$ts->addGlobal(['show_aging' => $this->options['show_aging_table']]);
|
||||||
$ts->addGlobal(['show_payments' => $this->options['show_payments_table']]);
|
$ts->addGlobal(['show_payments' => $this->options['show_payments_table']]);
|
||||||
|
$ts->addGlobal(['currency_code' => $this->client->company->currency()->code]);
|
||||||
|
|
||||||
$ts->build([
|
$ts->build([
|
||||||
'variables' => collect([$variables]),
|
'variables' => collect([$variables]),
|
||||||
|
@ -613,8 +613,6 @@ class TemplateService
|
|||||||
|
|
||||||
$this->payment = $payment;
|
$this->payment = $payment;
|
||||||
|
|
||||||
$this->addGlobal(['currency_code' => $payment->currency->code ?? $this->company->currency()->code]);
|
|
||||||
|
|
||||||
$credits = $payment->credits->map(function ($credit) use ($payment) {
|
$credits = $payment->credits->map(function ($credit) use ($payment) {
|
||||||
return [
|
return [
|
||||||
'credit' => $credit->number,
|
'credit' => $credit->number,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user