@extends('layouts.admin') @section('heading', 'Reports') @section('subheading', 'Sales, pipeline, balances, and salary — filtered and exportable.') @section('actions')
Export Excel Export PDF
@endsection @section('content')
@foreach(['sales' => 'Sales', 'pipeline' => 'Pipeline', 'balances' => 'Balances', 'salary' => 'Salary'] as $key => $label) {{ $label }} @endforeach
@if(in_array($tab, ['sales', 'salary']))
@endif @if($tab === 'sales')

Orders

{{ $data['total_orders'] }}

Revenue

₹{{ number_format($data['total_revenue'], 0) }}

Advance collected

₹{{ number_format($data['total_advance'], 0) }}

Balance pending

₹{{ number_format($data['total_balance'], 0) }}

@forelse($data['orders'] as $o) @empty @endforelse
OrderCustomer DateTotal
#{{ $o->id }}{{ $o->customer->name ?? '—' }} {{ $o->created_at->format('d M Y') }}₹{{ number_format($o->total_amount, 0) }}
No orders in this range.
@endif @if($tab === 'pipeline')
@foreach($data['counts'] as $stage => $count)
{{ $count }}
{{ $stage }}
@endforeach
@endif @if($tab === 'balances')

Total outstanding

₹{{ number_format($data['total_outstanding'], 0) }}

Customers owing

{{ $data['customer_count'] }}

@forelse($data['orders'] as $o) @empty @endforelse
OrderCustomer Balance
#{{ $o->id }}{{ $o->customer->name ?? '—' }} ₹{{ number_format($o->balance_amount, 0) }}
No outstanding balances.
@endif @if($tab === 'salary')

Total paid in range

₹{{ number_format($data['total_paid'], 0) }}

@forelse($data['payments'] as $p) @empty @endforelse
StaffDate NotesAmount
{{ $p->staff->name ?? '—' }} {{ $p->staff->staff_code ?? '' }} {{ $p->paid_on->format('d M Y') }}{{ $p->notes ?? '—' }} ₹{{ number_format($p->amount, 0) }}
No payments in this range.
@endif @endsection