@extends('admin.layout.master') @section('title',($type==3?'SALES':'SALES RETURN').' Summery') @section('custom_style') @endsection @section ('content')
@include('admin.layout.title_header', ['title'=>'SALES SUMMERY(ITEM WISE)'])
{{--
--}} {{--
--}}
@php $printData['title']='SHOWROOM-WISE '.($type==3?'SALES':'SALES RETURN'); $printData['start_date']=Request()->date_from?date('d-M-Y',strtotime(Request()->date_from)):date('d-M-Y'); $printData['end_date']=Request()->date_to?date('d-M-Y',strtotime(Request()->date_to)):date('d-M-Y'); $printData['showroom']=Request()->showroom && Request()->showroom!=0?$customers->where('id',Request()->showroom)->first()->name_eng:'All Showroom'; $printData['search_by']=(Request()->product_id?strtoupper($products->find(Request()->product_id)->name_eng):''); $routeName=Route::currentRouteName(); $printData=getPrintData($routeName,$printData); @endphp {!!$printData['head']!!} {{--

{{Request()->product_id?strtoupper($products->find(Request()->product_id)->name_eng):''}}

SHOWROOM-WISE {{($type==3?'SALES':'SALES RETURN')}} SUMMERY

@if(Request()->date_from)
{{ 'From '.date('d-M-Y',strtotime(Request()->date_from)).' To '.date('d-M-Y',strtotime(Request()->date_to))}}
@endif --}} @forelse ($months as $month=>$dates) @empty @endforelse @forelse ($dateArray as $date) @empty @endforelse @php $i=1; $total=[]; @endphp @forelse ($showRooms as $party_id => $showRoom) @php $s_qty=0; @endphp @forelse ($dateArray as $date) @php if($dayWiseSales->has($date)){ $qty=0; foreach ($dayWiseSales[$date]->where('party_id',$party_id)->groupBy('product_id') as $product_id=>$items){ if(Request()->get_value==1){ $qty=$items->sum(function($t){ return ($t->quantity * $t->avg_price)-(($t->quantity * $t->avg_price * $t->dc_price)/100);}); }else{ $qty=$items->sum('quantity'); } } }else{ $qty=0; } if(array_key_exists($date,$total)){ $total[$date]+=$qty; }else{ $total[$date]=$qty; } $s_qty+=$qty; @endphp @empty @endforelse @empty @endforelse @php $ts_qty=0; @endphp @forelse ($dateArray as $date) @php $tqty=0; if(array_key_exists($date,$total)){ $tqty=$total[$date]; } $ts_qty+=$tqty; @endphp @empty @endforelse
# Showroom{{$month}}Total
{{date('d',strtotime($date))}}
{{$i++}} {{$showRoom->first()->showroom->name_eng}}{{number_format($qty,2)}}{{number_format($s_qty,2)}}
TOTAL{{number_format($tqty,2)}}{{number_format($ts_qty,2)}}

{{-- @include('inventory.order.detail_modal') --}} @endsection @section('script') @stop