invoices-table fix for balance due

This commit is contained in:
Benjamin Beganović 2020-09-18 14:47:36 +02:00
parent 2bb84fdbd9
commit a1e11cf161
2 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ class InvoiceController extends Controller
$total = $invoices->sum('balance'); $total = $invoices->sum('balance');
$invoices = $invoices->filter(function ($invoice) { $invoices = $invoices->filter(function ($invoice) {
return $invoice->isPayable(); return $invoice->isPayable() && $invoice->balance > 0;
}); });
if ($invoices->count() == 0) { if ($invoices->count() == 0) {

View File

@ -86,7 +86,7 @@
{!! App\Models\Invoice::badgeForStatus($invoice->status) !!} {!! App\Models\Invoice::badgeForStatus($invoice->status) !!}
</td> </td>
<td class="flex items-center justify-end px-6 py-4 text-sm font-medium leading-5 whitespace-no-wrap"> <td class="flex items-center justify-end px-6 py-4 text-sm font-medium leading-5 whitespace-no-wrap">
@if($invoice->isPayable()) @if($invoice->isPayable() && $invoice->balance > 0)
<form action="{{ route('client.invoices.bulk') }}" method="post"> <form action="{{ route('client.invoices.bulk') }}" method="post">
@csrf @csrf
<input type="hidden" name="invoices[]" value="{{ $invoice->hashed_id }}"> <input type="hidden" name="invoices[]" value="{{ $invoice->hashed_id }}">