@extends('layouts.app') @section('title', 'Sales Report') @section('content') {{-- Period Presets --}}
Period: @foreach(['7days' => '7 Days', '1month' => '1 Month', '6months' => '6 Months', '1year' => '1 Year'] as $key => $label) {{ $label }} @endforeach
@if((request('period') && request('period') !== '1month') || request('customer_id') || request('invoice_type')) Clear @endif

Total Revenue

₹{{ number_format($revenue, 2) }}

Total Tax

₹{{ number_format($tax, 2) }}

{{-- Sales Chart --}}

Sales Over Time

@forelse($invoices as $invoice) @empty @endforelse
Invoice # Customer Date Type Subtotal Tax Total Status
{{ $invoice->invoice_number }} {{ $invoice->customer->customer_name ?? '—' }} {{ $invoice->invoice_date?->format('d-m-Y') }} @if($invoice->invoice_type === 'tax') Tax @else Non-Tax @endif ₹{{ number_format($invoice->subtotal, 2) }} ₹{{ number_format($invoice->tax_amount, 2) }} ₹{{ number_format($invoice->grand_total, 2) }} @php $statusClasses = ['pending' => 'badge-warning', 'paid' => 'badge-success', 'cancelled' => 'badge-danger'][$invoice->status] ?? 'badge-gray'; @endphp {{ $invoice->status }}
No sales records found.
@if($invoices->hasPages())
@endif
@endsection @push('scripts') @endpush