@extends('layouts.admin') @section('title', 'Reports') @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'; $box = 'rounded-2xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800'; $cards = [ ['Total sales (with VAT)', 'AED ' . number_format($summary->total, 2), $summary->invoices . ' invoices', 'text-emerald-500'], ['VAT collected', 'AED ' . number_format($summary->vat, 2), 'Subtotal ' . number_format($summary->subtotal, 2), 'text-brand-500'], ['Gross profit', 'AED ' . number_format($profit, 2), 'VAT chhara, kena dam badh diye', $profit >= 0 ? 'text-sky-500' : 'text-red-500'], ['Due (ei invoice gulor)', 'AED ' . number_format($summary->due, 2), 'Ekhono baki', 'text-red-500'], ['Due collected', 'AED ' . number_format($collected, 2), 'Ei somoy e neya payment', 'text-emerald-500'], ]; $y = now()->format('Y-m-d'); @endphp {{-- Breadcrumb --}}
Reports/Sales & VAT report
@if ($errors->any())
@endif {{-- Filter --}}
Today This month Last month This year
Report period: {{ \Carbon\Carbon::parse($from)->format('d M Y') }} theke {{ \Carbon\Carbon::parse($to)->format('d M Y') }}
{{-- Summary cards --}}
@foreach ($cards as [$label, $value, $note, $color])
{{ $label }}
{{ $value }}
{{ $note }}
@endforeach
{{-- Daily chart + table --}}

Daily sales

@if ($daily->count())
@else
Ei somoy e kono sale nai.
@endif
Day by day
@forelse ($daily as $d) @empty @endforelse
DateVATTotal
{{ $d->date->format('d M') }} ({{ $d->invoices }}) {{ number_format($d->vat, 2) }} {{ number_format($d->total, 2) }}
Kichu nai.
{{-- Top products + customer due --}}
Top selling products
@forelse ($topProducts as $t) @empty @endforelse
ProductQtySalesProfit
{{ $t->product_name }}
{{ $t->product_code }}
{{ $t->qty }} {{ number_format($t->revenue, 2) }} {{ number_format($t->profit, 2) }}
Ei somoy e kono product bikri hoyni.
Customer due (shob somoyer)
@forelse ($dueCustomers as $c) @empty @endforelse
CustomerPhoneDue
{{ $c->name }} {{ $c->phone ?: '—' }} {{ number_format($c->due_total, 2) }}
Kono customer er due nai.
{{-- Stock --}}
Stock (ekhon)
Stock value (kena dam)
AED {{ number_format($stockCost, 2) }}
Stock value (becha dam)
AED {{ number_format($stockRetail, 2) }}
Low stock product
{{ $lowStockCount }}
@if ($lowStock->count())
@foreach ($lowStock as $p) @endforeach
ProductCategoryAlert atStock
{{ $p->name }}
{{ $p->code }}
{{ $p->category->name }} {{ $p->stock_alert }} {{ $p->stock_qty }}
@endif
@endsection @push('scripts') @if ($daily->count()) @endif @endpush