@extends('layouts.admin') @section('title', 'Invoices') @section('content') @php $field = 'h-11 px-3 rounded-xl border border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-sm outline-none focus:ring-2 ring-brand-500'; $badge = [ 'paid' => 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400', 'partial' => 'bg-amber-500/10 text-amber-600 dark:text-amber-400', 'due' => 'bg-red-500/10 text-red-500', ]; $item = 'flex items-center gap-3 w-full px-4 py-2.5 text-sm font-medium text-left hover:bg-slate-100 dark:hover:bg-slate-700'; $cards = [ ['Total invoices', number_format($stats->invoice_count), 'text-sky-500'], ['Total amount (with VAT)', 'AED ' . number_format($stats->total_sum, 2), 'text-emerald-500'], ['VAT collected', 'AED ' . number_format($stats->vat_sum, 2), 'text-brand-500'], ['Total due', 'AED ' . number_format($stats->due_sum, 2), 'text-red-500'], ]; $today = now()->format('Y-m-d'); @endphp {{-- Breadcrumb --}}
Invoices/All invoices
@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
@endif {{-- Summary (filter onujayi) --}}
@foreach ($cards as [$label, $value, $color])
{{ $label }}
{{ $value }}
@endforeach
{{-- Filter --}}
@if (request()->hasAny(['q', 'from', 'to', 'status'])) Reset @endif
{{-- Quick buttons --}}
{{-- Table --}}
@forelse ($invoices as $inv) @empty @endforelse
Invoice Date Customer Subtotal VAT Total Paid Due Status Action
{{ $inv->invoice_no }} {{ $inv->date->format('d M Y') }}
{{ $inv->customer_name }}
@if ($inv->customer_phone)
{{ $inv->customer_phone }}
@endif
{{ number_format($inv->subtotal, 2) }} {{ number_format($inv->vat_amount, 2) }} {{ number_format($inv->total, 2) }} {{ number_format($inv->paid_amount, 2) }} {{ number_format($inv->due_amount, 2) }} {{ $inv->payment_status }} {{-- 3-dot button --}} {{-- Menu (JS diye position hoy, tai table er bhetore kete jay na) --}}
Kono invoice paoa jayni. Notun sale koro
@if ($invoices->hasPages())
{{ $invoices->links() }}
@endif
@endsection @push('scripts') @endpush