@if (isset($list) && count($list) > 0) @foreach ($list as $item) @endforeach @endif
Purchase No Purchase Date Vendor Invoice No Vendor Age Payment Status Items Subtotal Total Invoice Amount Total Paid Amount Total Balance Amount Status Action Files
{{ $item->purchase_no ?? '-' }} {{ $item->purchase_date ? \Carbon\Carbon::parse($item->purchase_date)->format('d/m/Y') : '-' }} {{ $item->vendor_invoice_no ?? '-' }} {{ $item->company_name ?? '-' }} @php $age = $item->purchase_date ? \Carbon\Carbon::parse($item->purchase_date)->diffInDays(now()) : 0; $age = $age < 0 ? 0 : ceil($age); @endphp {{ $age }} days {{ ucfirst($item->payment_status ?? 'unpaid') }} {{ $item->items->count() ?? 0 }} ₹{{ number_format($item->subtotal ?? 0, 2) }} ₹{{ number_format($item->grand_total ?? 0, 2) }} ₹{{ number_format($item->paid_amount ?? 0, 2) }} ₹{{ number_format($item->balance_amount ?? 0, 2) }} @php $status = $item->status ?? 'pending'; $statusClass = 'badge-secondary'; switch ($status) { case 'approved': $statusClass = 'badge-success'; break; case 'rejected': $statusClass = 'badge-danger'; break; case 'pending': default: $statusClass = 'badge-warning'; break; } @endphp {{ ucfirst($status) }}
@if ($item->status === 'pending') @endif
@foreach($item->files as $file) @endforeach
@if(isset($list) && $list instanceof \Illuminate\Pagination\LengthAwarePaginator)
Showing {{ $list->firstItem() }} to {{ $list->lastItem() }} of {{ $list->total() }} entries
{{ $list->appends(request()->query())->links() }}
@endif @push('scripts') @endpush