@extends('layouts.admin') @section('page-title', 'Client-wise Conveyance – ' . ($currentMonthLabel ?? '')) @section('page-subtitle', 'Submitted conveyance grouped by client with filters and export') @section('content') {{-- FILTER CARD --}}

Filters – Client-wise Conveyance

Filter submitted conveyance by month, date range, session, and client. Export follows the same filters.

{{-- Month --}}
{{-- From Date --}}
{{-- To Date --}}
{{-- Session --}}
{{-- Client --}}
Clear all filters
{{-- HEADER INFO --}} @php $groups = $rows->groupBy('client_id'); @endphp

Client-wise Conveyance – {{ $currentMonthLabel ?? '' }}

Showing submitted entries between {{ $monthStart ? $monthStart->format('d M Y') : '—' }} and {{ $monthEnd ? $monthEnd->format('d M Y') : '—' }} .

Clients: {{ $groups->count() }}  •  Grand Total: ₹ {{ number_format($grandTotal ?? 0, 2) }}

@if($rows->isEmpty())
No submitted conveyance entries found for selected filters.
@else
@foreach($groups as $clientId => $items) @php $client = optional($items->first()->client); $clientName = $client->name ?? 'No Client Selected'; // Effective total per client (onward + return/custom) $totalAmount = $items->sum(function($c) { $onward = (float) $c->amount; if ($c->is_return) { $return = $c->return_amount !== null ? (float) $c->return_amount : $onward; return $onward + $return; } return $onward; }); $entryCount = $items->count(); $employeeGroups = $items->groupBy('user_id'); $employeeCount = $employeeGroups->count(); @endphp @endforeach
Client Total Amount (₹) Entries Employees Verification
{{ $clientName }}
Client ID: {{ $clientId ?? 'N/A' }}
₹ {{ number_format($totalAmount, 2) }} {{ $entryCount }} {{ $employeeCount }} @if($clientId) 🔎 Open Verification View @else No client linked @endif
Grand Total ₹ {{ number_format($grandTotal ?? 0, 2) }} (All clients in this view)
@endif @endsection