Optimise product tables

This commit is contained in:
Deon George
2022-04-22 15:23:08 +10:00
parent e1a4db700f
commit 16cc0c9f8d
10 changed files with 88 additions and 24 deletions

View File

@@ -27,7 +27,7 @@
<td>{{ number_format($io->total,2) }}</td>
<td>{{ number_format($io->due,2) }}</td>
<td class="text-right">
<input type="text" class="text-right invoice" name="invoices[{{ $io->id }}]" value="{{ number_format(($x=$io->paymentitems->filter(function($item) use ($pid) { return $item->payment_id == $pid; })) ? $x->sum('alloc_amt') : 0,2) }}">
<input type="text" class="text-right invoice" name="invoices[{{ $io->id }}]" value="{{ number_format(($x=$io->paymentitems->filter(function($item) use ($pid) { return $item->payment_id == $pid; })) ? $x->sum('amount') : 0,2) }}">
</td>
</tr>
@endforeach

View File

@@ -5,7 +5,7 @@
</div>
<div class="card-body">
@if(($x=$o->payments()->where('payments.date_orig','>',\Carbon\Carbon::now()->subMonths(12)->unix())->with(['items','account'])->get())->count())
@if(($x=$o->payments()->where('payments.created_at','>',\Carbon\Carbon::now()->subMonths(12)->unix())->with(['items','account'])->get())->count())
<table class="table table-bordered w-100" id="payments_past">
<thead>
<tr>
@@ -23,7 +23,7 @@
<tr>
<td>{{ $oo->account->name }}</td>
<td>{{ $oo->sid }}</td>
<td>{{ $oo->payment_date->format('Y-m-d') }}</td>
<td>{{ $oo->paid_at->format('Y-m-d') }}</td>
<td class="text-right">${{ number_format($oo->total,2) }}</td>
{{--<td class="text-right">${{ number_format($oo->balance,2) }}</td>--}}
<td>