@extends('admin.layout.master') @section('title','MARKETING ORDER '.($type==1?'RETURN':'').' LIST') @section('custom_style') @endsection @section ('content')

ORDER {{$type==1?'RETURN':''}} LIST

{{-- --}}
{{-- --}} {{--
--}} {{-- --}} {{--
--}}
{{--
--}}
{{--
--}} {{--
--}}
{{--
--}} {{--
--}}
@csrf
{{--
--}} {{-- @if(isMarketingEnable()==1 && Request()->status==0) @endif --}} {{-- --}} {{-- --}} @php $total=0; $p=1; $action_id=801; $isOrderShowedShopWise=[]; @endphp @forelse (Request()->shop_id?$shops->where('id',Request()->shop_id):$shops as $key=>$zone) @php $wareAmount=0; $zone_group=array_filter(explode(',',($zone->officer?$zone->officer->group_ids:null))); $parties=$showroom->whereIn('group_id',$zone_group)->pluck('id')->toArray(); $parties=array_merge($parties,$showroom->where('id',$zone->party_id)->pluck('id')->toArray()); if(count($parties)){ $transactions=$orders->whereIn('party_id',$parties)->where('transaction_type',14); $isOrderShowedShopWise=array_merge($isOrderShowedShopWise,$transactions->pluck('id')->toArray()); }else{ $transactions=[]; } @endphp {{-- style="background-color:#002952" --}} @forelse ($transactions as $i=>$item) @php $details=$item->details; $netTotal=$details->sum(function($q){ return ($q->order_price*$q->order_qty); }); $wareAmount+=$netTotal // $wareAmount+=$item->net_total; @endphp {{-- --}} @empty @endforelse @php $total+=$wareAmount; @endphp @empty @endforelse @php $transactions=$orders->whereNotIn('id',$isOrderShowedShopWise)->where('transaction_type',14); @endphp @forelse ($transactions as $i=>$item) @php $details=$item->details; $netTotal=$details->sum(function($q){ return ($q->order_price*$q->order_qty);}); $wareAmount+=$netTotal // $wareAmount+=$item->net_total; @endphp {{-- --}} @empty @endforelse
# Date Order No DealerOrder TypeGroupStore Amount Delivery
Action
{{$zone->name}}
{{ ($p++) }} {{ date('d-M-Y h:i A',strtotime($item->created_at)) }} {{ $item->order_no }} {{ $item->showroom?$item->showroom->name_eng:'N\A' }} {{ $item->warehouse?$item->warehouse->name_eng:'' }}{{ number_format($netTotal,2) }}{{ number_format($item->net_total,2) }} {{ ($item->delivery_status==2?'DELIVERED':($item->delivery_status==0?'PENDING':'REJECTED')) }} @if(($item->approve_status==2)) @else {!! getApprovalInputField($item->id,801) !!} @endif Print @if(checkAuthPermission('order.edit')) @if ($item->delivery_status == 0) Edit @elseif ($item->delivery_status == 1) @endif @endif
{{'THERE IS NO ORDER YET '.strtoupper($zone->name).' '.($zone->type==5?'REGION':'ZONE')}}
{{'Total : '}}{{number_format($wareAmount,2)}}
THIS STORE
{{ ($p++) }} {{ date('d-M-Y h:i A',strtotime($item->created_at)) }} {{ $item->order_no }} {{ $item->showroom?$item->showroom->name_eng:'N\A' }} {{ $item->warehouse?$item->warehouse->name_eng:'' }}{{ number_format($netTotal,2) }}{{ number_format($item->net_total,2) }} {{ ($item->delivery_status==2?'DELIVERED':($item->delivery_status==0?'PENDING':'REJECTED')) }} @if(($item->approve_status==2)) @else {!! getApprovalInputField($item->id,801) !!} @endif Print @if ($item->delivery_status == 0 && get_guard()=='admin') @if(checkAuthPermission('order.edit')) Edit @endif @endif
{{'THERE IS NO ORDER YET FOR THIS STORE'}}
{{'Grand Total : '}}{{number_format($total,2)}}

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