Optimise Invoice
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
@if(($x=$o->invoices()
|
||||
->where('active',TRUE)
|
||||
->orderBy('due_at')
|
||||
->with(['items.taxes','paymentitems.payment','account'])
|
||||
->with(['items.taxes','payment_items.payment','account'])
|
||||
->get()
|
||||
->filter(function($item) use ($pid) { return $item->due > 0 || $item->payments->search(function($item) use ($pid) { return $item->id == $pid; }) !== FALSE; }))->count())
|
||||
<table class="table table-hover">
|
||||
@@ -22,12 +22,12 @@
|
||||
@foreach ($x as $io)
|
||||
<tr>
|
||||
<td><a href="{{ url('u/invoice',[$io->id]) }}">{{ $io->sid }}</a></td>
|
||||
<td>{{ $io->invoice_date->format('Y-m-d') }}</td>
|
||||
<td>{{ $io->created_at->format('Y-m-d') }}</td>
|
||||
<td>{{ $io->due_at->format('Y-m-d') }}</td>
|
||||
<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 }}][id]" value="{{ number_format(($x=$io->paymentitems->filter(function($item) use ($pid) { return $item->payment_id == $pid; })) ? $x->sum('amount') : 0,2) }}">
|
||||
<input type="text" class="text-right invoice" name="invoices[{{ $io->id }}][id]" value="{{ number_format(($x=$io->payment_items->filter(function($item) use ($pid) { return $item->payment_id == $pid; })) ? $x->sum('amount') : 0,2) }}">
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
Reference in New Issue
Block a user