@extends('layouts.admin') @section('title', 'All Purchases') @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', ]; $cards = [ ['Total purchases', number_format($stats->purchase_count), 'text-sky-500'], ['Total amount (with VAT)', 'AED ' . number_format($stats->total_sum, 2), 'text-emerald-500'], ['Input VAT', 'AED ' . number_format($stats->vat_sum, 2), 'text-brand-500'], ['Due to suppliers', 'AED ' . number_format($stats->due_sum, 2), 'text-red-500'], ]; $today = now()->format('Y-m-d'); @endphp {{-- Breadcrumb --}}
Purchases/All purchases
@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', 'supplier', 'from', 'to', 'status'])) Reset @endif
+ Create Purchase
{{-- Table --}}
@forelse ($purchases as $p) @empty @endforelse
Reference Date Supplier Total Paid Due Status Action
{{ $p->reference }}
@if ($p->supplier_invoice_no)
Bill: {{ $p->supplier_invoice_no }}
@endif
{{ $p->date->format('d M Y') }} {{ $p->supplier->name }} {{ number_format($p->total, 2) }} {{ number_format($p->paid_amount, 2) }} {{ number_format($p->due_amount, 2) }} {{ $p->payment_status }} View Return
No purchase record found Notun purchase koro
@if ($purchases->hasPages())
{{ $purchases->links() }}
@endif
@endsection