Invoices
@if(Auth::user()->user_flg !== 'C') +  New Invoice @endif
@foreach ($invoices as $invoice) @endforeach
ID Client Invoice Date Due Date Amount Payment Status Delivery Status Created by Action

{{ $invoice->invoice_id }}

{{ $invoice->client->user->name ?? '' }} {{ $invoice->client->user->last_name ?? '' }}

{{ $invoice->invoice_date ? \Carbon\Carbon::parse($invoice->invoice_date)->format('d-m-Y') : '' }}

{{ $invoice->due_date ? \Carbon\Carbon::parse($invoice->due_date)->format('d-m-Y') : ''}}

{{ $invoice->final_amount }}

@php $status = optional($payment_status->firstWhere('id', $invoice->status))->name; $badgeClass = match($status) { 'Paid' => 'bg-success', 'Partially Paid' => 'bg-warning text-dark', 'Unpaid' => 'bg-danger', }; @endphp {{ $status ?? 'Unknown' }}

@if ($invoice->delivery_status == 1) In Progress @elseif($invoice->delivery_status == 2) Delivered @else Unknown @endif

{{$invoice->createdBy->name ?? ''.' '. $invoice->createdBy->last_name ?? ''}} @if(Auth::user()->user_flg !== 'C')
@csrf @method('DELETE')
@endif @if(Auth::user()->user_flg == 'C') @endif