@foreach ($users as $key => $user) @php $totalCustomerCount = 0; $totalOrderedOrVisted = 0; $totalOrderedCount = 0; $totalOrderAmount = 0; $totalBilledAmount = 0; $totalCollectionAmount = 0; @endphp @if (empty($user->routes)) @else @php $totalCustomerCount += $user->routes[0]['count']; $totalOrderedOrVisted += $user->routes[0]['ordered_or_visted']; $totalOrderedCount += $user->routes[0]['ordered_count']; $totalOrderAmount += $user->routes[0]['order_amount']; $totalBilledAmount += $user->routes[0]['billed_amount']; $totalCollectionAmount += $user->routes[0]['collection_amount']; @endphp @endif @foreach ($user->routes as $key => $route) @if ($key == 0) @continue @endif @php $totalCustomerCount += $route['count']; $totalOrderedOrVisted += $route['ordered_or_visted']; $totalOrderedCount += $route['ordered_count']; $totalOrderAmount += $route['order_amount']; $totalBilledAmount += $route['billed_amount']; $totalCollectionAmount += $route['collection_amount']; @endphp @endforeach @endforeach
SL Name Start Time End Time Duration Routes Customer Count Total Customer Ordered / Visited Ordered Customer Count Order Amount Billed Amount Collection Amount
DSSR Report
From : {{ $fromDate }} To : {{ $toDate }}
{{ $key + 1 }} {{ $user->name }} {{ $user->start_time }} {{ $user->end_time }} {{ $user->duration }}-- -- -- -- -- -- --{{ $user->routes[0]['route_name'] }} {{ $user->routes[0]['count'] }} {{ $user->routes[0]['ordered_or_visted'] }} {{ $user->routes[0]['ordered_count'] }} {{ $user->routes[0]['order_amount'] }} {{ $user->routes[0]['billed_amount'] }} {{ $user->routes[0]['collection_amount'] }}
{{ $route['route_name'] }} {{ $route['count'] }} {{ $route['ordered_or_visted'] }} {{ $route['ordered_count'] }} {{ $route['order_amount'] }} {{ $route['billed_amount'] }} {{ $route['collection_amount'] }}
{{ $totalCustomerCount }} {{ $totalOrderedOrVisted }} {{ $totalOrderedCount }} {{ $totalOrderAmount }} {{ $totalBilledAmount }} {{ $totalCollectionAmount }}