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

Product Sales Report

Export Excel

Segment Wise

@if(count($data['segments'])>0) @foreach($data['segments'] as $segment) @endforeach @endif @if(count($data['segments'])>0) @foreach($data['segments'] as $segment) @endforeach @endif @if (collect($data['data'])->count()>0) @foreach (collect($data['data'])->unique('item_sku') as $item) @php $total_revenue = 0; @endphp @if(isset($item)) @foreach($data['segments'] as $segment) @php $count=0; @endphp @foreach(collect($data['data'])->where('item_sku', $item->item_sku) as $itemDetails) @if($itemDetails->segment==$segment) @php $total_revenue += $itemDetails->revenue; @endphp @php $count++; @endphp @endif @endforeach @if($count==0) @endif @endforeach @else @foreach($data['segments'] as $segment) @endforeach @endif @endforeach @endif
SKU Product{{$segment}}Total Revenue
Qty Amount
{{$item->item_sku}} {{$item->item_name}}{{number_format($itemDetails->qty,2)}} {{number_format($itemDetails->revenue,2)}}0 00 0{{number_format($total_revenue,2)}}
@endsection @section('scripts') @endsection