added amount due to email templates
This commit is contained in:
parent
ab0553bfb4
commit
dbab1d93c3
@ -298,6 +298,18 @@ class Document extends Model
|
|||||||
return round($paid, $precision);
|
return round($paid, $precision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the not paid amount.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getAmountDueAttribute()
|
||||||
|
{
|
||||||
|
$precision = config('money.' . $this->currency_code . '.precision');
|
||||||
|
|
||||||
|
return round($this->amount - $this->paid, $precision);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the status label.
|
* Get the status label.
|
||||||
*
|
*
|
||||||
|
@ -66,6 +66,7 @@ class Bill extends Notification
|
|||||||
return [
|
return [
|
||||||
'{bill_number}',
|
'{bill_number}',
|
||||||
'{bill_total}',
|
'{bill_total}',
|
||||||
|
'{bill_amount_due}',
|
||||||
'{bill_due_date}',
|
'{bill_due_date}',
|
||||||
'{bill_admin_link}',
|
'{bill_admin_link}',
|
||||||
'{vendor_name}',
|
'{vendor_name}',
|
||||||
@ -80,8 +81,9 @@ class Bill extends Notification
|
|||||||
public function getTagsReplacement()
|
public function getTagsReplacement()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
$this->bill->bill_number,
|
$this->bill->document_number,
|
||||||
money($this->bill->amount, $this->bill->currency_code, true),
|
money($this->bill->amount, $this->bill->currency_code, true),
|
||||||
|
money($this->bill->amount_due, $this->bill->currency_code, true),
|
||||||
company_date($this->bill->due_at),
|
company_date($this->bill->due_at),
|
||||||
route('bills.show', $this->bill->id),
|
route('bills.show', $this->bill->id),
|
||||||
$this->bill->contact_name,
|
$this->bill->contact_name,
|
||||||
|
@ -74,6 +74,7 @@ class Invoice extends Notification
|
|||||||
return [
|
return [
|
||||||
'{invoice_number}',
|
'{invoice_number}',
|
||||||
'{invoice_total}',
|
'{invoice_total}',
|
||||||
|
'{invoice_amount_due}',
|
||||||
'{invoice_due_date}',
|
'{invoice_due_date}',
|
||||||
'{invoice_guest_link}',
|
'{invoice_guest_link}',
|
||||||
'{invoice_admin_link}',
|
'{invoice_admin_link}',
|
||||||
@ -92,6 +93,7 @@ class Invoice extends Notification
|
|||||||
return [
|
return [
|
||||||
$this->invoice->document_number,
|
$this->invoice->document_number,
|
||||||
money($this->invoice->amount, $this->invoice->currency_code, true),
|
money($this->invoice->amount, $this->invoice->currency_code, true),
|
||||||
|
money($this->invoice->amount_due, $this->invoice->currency_code, true),
|
||||||
company_date($this->invoice->due_at),
|
company_date($this->invoice->due_at),
|
||||||
URL::signedRoute('signed.invoices.show', [$this->invoice->id, 'company_id' => $this->invoice->company_id]),
|
URL::signedRoute('signed.invoices.show', [$this->invoice->id, 'company_id' => $this->invoice->company_id]),
|
||||||
route('invoices.show', $this->invoice->id),
|
route('invoices.show', $this->invoice->id),
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<div class="{{ $classHeaderStatus }}">
|
<div class="{{ $classHeaderStatus }}">
|
||||||
{{ trans_choice('general.statuses', 1) }}
|
{{ trans_choice('general.statuses', 1) }}
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<strong>
|
<strong>
|
||||||
<span class="float-left">
|
<span class="float-left">
|
||||||
<span class="badge badge-{{ $document->status_label }}">
|
<span class="badge badge-{{ $document->status_label }}">
|
||||||
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
<strong>
|
<strong>
|
||||||
<span class="float-left">
|
<span class="float-left">
|
||||||
@money($document->amount - $document->paid, $document->currency_code, true)
|
@money($document->amount_due, $document->currency_code, true)
|
||||||
</span>
|
</span>
|
||||||
</strong>
|
</strong>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
@ -20,8 +20,13 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
@foreach($templates as $template)
|
@foreach($templates as $template)
|
||||||
@php $aria_expanded_status = in_array($card, [1, 2]) ? 'true' : 'false'; @endphp
|
@php
|
||||||
@php $collapse_status = in_array($card, [1, 2]) ? 'show' : ''; @endphp
|
if (!class_exists($template->class)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$aria_expanded_status = in_array($card, [1, 2]) ? 'true' : 'false';
|
||||||
|
$collapse_status = in_array($card, [1, 2]) ? 'show' : '';
|
||||||
|
@endphp
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="accordion" id="accordion-{{ $card }}">
|
<div class="accordion" id="accordion-{{ $card }}">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user