@extends('layouts.portal') @section('title', 'Service Report') @push('styles') @endpush @section('content') {{-- Print Toolbar (hidden on print) --}} {{-- Report Header --}}

Service Usage Report

{{ $user->name }} @if($user->shop_name) · {{ $user->shop_name }} @endif · {{ $user->role_label }}
@if($from === $to) 📅 {{ \Carbon\Carbon::parse($from)->format('d M Y') }} @else 📅 {{ \Carbon\Carbon::parse($from)->format('d M Y') }} → {{ \Carbon\Carbon::parse($to)->format('d M Y') }} @endif
Printed: {{ now()->format('d M Y, h:i A') }}
{{-- Summary Stats --}}

{{ $requests->count() }}

Total Requests

{{ $requests->where('status','success')->count() }}

Success

{{ $requests->whereIn('status',['pending','processing'])->count() }}

Pending

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

Total Charged
{{-- Requests Table --}} @if($requests->isEmpty())

Is date ke liye koi request nahi hai.

@else
@foreach($requests as $i => $req) @endforeach
# Request No. Service Name Input Amount Status Date & Time
{{ $i + 1 }} {{ $req->request_no }} {{ $req->service->name ?? 'N/A' }} @php $inp = $req->input_data ?? []; $display = $inp['mobile'] ?? $inp['epic_number'] ?? $inp['vehicle_number'] ?? $inp['aadhaar_number'] ?? $inp['reference'] ?? (is_array($inp) ? implode(', ', array_slice(array_values($inp), 0, 2)) : '-'); @endphp {{ $display }} @if($req->charge > 0) ₹{{ number_format($req->charge, 2) }} @else @endif {{ ucfirst($req->status) }} {{ $req->created_at->format('d M Y') }}
{{ $req->created_at->format('h:i A') }}
Total Amount Charged: ₹{{ number_format($totalCharge, 2) }}
@endif {{-- Footer bar (screen only) --}} @endsection