Optimise Invoice

This commit is contained in:
2024-07-09 20:17:30 +10:00
parent 29bccbf72f
commit f561139d45
11 changed files with 146 additions and 185 deletions

View File

@@ -6,8 +6,8 @@ A new invoice has been generated on your account. A summary of that invoice is b
@component('mail::table')
| # | ID | Name | Amount |
| -: | - |:-----| ------:|
@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) }} |
@foreach ($invoice->summary_products() as $item)
| {{ $item['services']->count() }} | {{ $item['product']->lid }} | {{ $item['product']->name }} | ${{ number_format($item['total'],2) }} |
@endforeach
||| Sub Total | ${{ number_format($invoice->sub_total,2) }} |
||| Tax | ${{ number_format($invoice->tax_total,2) }} |