1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Add and email variables

This commit is contained in:
Hillel Coren 2017-05-30 16:02:15 +03:00
parent 72db373a41
commit e8437a9bbd
3 changed files with 14 additions and 0 deletions

View File

@ -29,6 +29,14 @@ class InvoicePresenter extends EntityPresenter
return $account->formatMoney($invoice->amount, $invoice->client);
}
public function balance()
{
$invoice = $this->entity;
$account = $invoice->account;
return $account->formatMoney($invoice->balance, $invoice->client);
}
public function requestedAmount()
{
$invoice = $this->entity;

View File

@ -55,6 +55,8 @@ class TemplateService
'$contact' => $contact->getDisplayName(),
'$firstName' => $contact->first_name,
'$amount' => $account->formatMoney($data['amount'], $client),
'$total' => $invoice->present()->amount,
'$balance' => $invoice->present()->balance,
'$invoice' => $invoice->invoice_number,
'$quote' => $invoice->invoice_number,
'$link' => $invitation->getLink(),

View File

@ -21,6 +21,8 @@
'invoiceDate': invoice ? invoice.invoice_date : "{{ $account->formatDate($account->getDateTime()) }}",
'client': invoice ? getClientDisplayName(invoice.client) : "{{ trans('texts.client_name') }}",
'amount': invoice ? formatMoneyInvoice(parseFloat(invoice.partial) || parseFloat(invoice.balance_amount), invoice) : formatMoneyAccount(100, account),
'balance': invoice ? formatMoneyInvoice(parseFloat(invoice.balance), invoice) : formatMoneyAccount(100, account),
'total': invoice ? formatMoneyInvoice(parseFloat(invoice.amount), invoice) : formatMoneyAccount(100, account),
'contact': invoice ? getContactDisplayName(invoice.client.contacts[0]) : 'Contact Name',
'firstName': invoice ? invoice.client.contacts[0].first_name : 'First Name',
'invoice': invoice ? invoice.invoice_number : '0001',
@ -111,6 +113,8 @@
'invoice',
'quote',
'amount',
'total',
'balance',
'invoiceDate',
'dueDate',
'documents',