@extends('layouts.master') @section('styles') @endsection @section('content')

Report Management

{{--{{dd($data)}}--}}
Export Excel

Distributor Wise Sales Report

@if(count($data['dates'])>0) @foreach($data['dates'] as $dates) @endforeach @endif @if(count($data['dates'])>0) @foreach($data['dates'] as $dates) @endforeach @endif @php $sr = 1; @endphp @if (collect($data['data'])->count()>0) @foreach (collect($data['data'])->unique('distributor_id') as $key => $item) @php $totalBQty = 0; $totalEQty = 0; @endphp @foreach($data['dates'] as $date) @php $count=0; @endphp @foreach(collect($data['data'])->where('distributor_id',$item->distributor_id) as $keyD => $itemD) @if($itemD->booking_date==$date) @php $count++; $totalBQty += $itemD->booked_qty; $totalEQty += $itemD->executed_qty; @endphp @endif @endforeach @if($count==0) @endif @endforeach @endforeach @endif
S. No# Distributor Name Region Area Territory{{$dates}}Total
B. Qty E. QtyB. Qty E. Qty
{{$sr++}} {{$item->distributor_name}} {{$item->region_name}} {{$item->area_name}} {{($item->territory_name)? $item->territory_name:'NA'}}{{number_format($itemD->booked_qty,2)}} {{number_format($itemD->executed_qty,2)}}0.00 0.00{{number_format($totalBQty, 2)}} {{number_format($totalEQty, 2)}}
@endsection @section('scripts') @endsection