From ffcab790fcac3be453e2934be545c9e2f5d004c3 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 29 Sep 2022 18:40:03 +1000 Subject: [PATCH] Fix invoice emailing, and improved formatting --- app/Models/Invoice.php | 4 ++-- resources/views/email/user/invoice.blade.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index e6a3b73..4443c95 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -11,7 +11,7 @@ use Illuminate\Support\Arr; use Leenooks\Traits\ScopeActive; use App\Interfaces\IDs; -use App\Traits\PushNew; +use App\Traits\{PushNew,SiteID}; /** * Class Invoice @@ -34,7 +34,7 @@ use App\Traits\PushNew; */ class Invoice extends Model implements IDs { - use Compoships,PushNew,ScopeActive; + use Compoships,PushNew,ScopeActive,SiteID; protected $casts = [ 'reminders'=>'json', diff --git a/resources/views/email/user/invoice.blade.php b/resources/views/email/user/invoice.blade.php index d9e79bc..e953c46 100644 --- a/resources/views/email/user/invoice.blade.php +++ b/resources/views/email/user/invoice.blade.php @@ -9,9 +9,9 @@ A new invoice has been generated on your account. A summary of that invoice is b @foreach ($invoice->products() as $po) | {{ $po->count }} | {{ $po->product_id }} | {{ $po->name }} | ${{ number_format($invoice->items->filter(function($item) use ($po) {return $item->product_id == $po->id; })->sum('total'),$invoice->currency()->rounding) }} | @endforeach -||| Sub Total | ${{ $invoice->sub_total }} | -||| Tax | ${{ $invoice->tax_total }} | -||| Total | ${{ $invoice->total }} | +||| Sub Total | ${{ number_format($invoice->sub_total,2) }} | +||| Tax | ${{ number_format($invoice->tax_total,2) }} | +||| Total | ${{ number_format($invoice->total,2) }} | @endcomponent If you would like a PDF copy of that invoice, please click on the link below: