@extends('admin.layout.app') @section('title', 'Sales Report') @section('content')

Sales Report

@if (session('success'))
{{ session('success') }}
@endif
Orders Table
@forelse ($sales_reports as $key => $report) @empty @endforelse @if($sales_reports->count()) @endif
# Order Number Customer Items Total Payment Method Order Status Date
{{ ($sales_reports->firstItem() ?? 0) + $key + 1 }} {{ $report->order_number }} {{ $report->customer_name ?? 'N/A' }}
{{ $report->customer_email ?? 'N/A' }}
{{ $report->items_count ?? 0 }} item(s) ₹{{ number_format($report->total_amount, 2) }} {{ ucfirst($report->payment_method ?? '-') }} @php $statusColors = [ 'pending' => 'warning', 'confirmed' => 'info', 'processing' => 'primary', 'shipped' => 'success', 'delivered' => 'success', 'cancelled' => 'danger' ]; $color = $statusColors[$report->order_status] ?? 'secondary'; @endphp {{ ucfirst($report->order_status ?? '-') }} {{ \Carbon\Carbon::parse($report->created_at)->format('d M Y') }}
{{ \Carbon\Carbon::parse($report->created_at)->format('h:i A') }}
No sales records found.
Totals: ₹{{ number_format($totals['total_amount'] ?? 0, 2) }}
@if($sales_reports instanceof \Illuminate\Pagination\LengthAwarePaginator && $sales_reports->hasPages())
{{ $sales_reports->links('pagination::bootstrap-4') }}
@endif
@endsection