@extends('admin.layout.master') @section('title','ORDER SHEET') @section('custom_style') @endsection @section ('content')

Order Analysis

 
@if(count($orders))
@php $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['warehouse']=Request()->warehouse_id && Request()->warehouse_id!=0?$warehouses->where('id',Request()->warehouse_id)->first()->name_eng:'All STORE'; $routeName=Route::currentRouteName(); $printData=getPrintData($routeName,$printData); @endphp {!!$printData['head']!!} @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 @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 {{-- $transactions --}} @php $total+=$wareAmount; @endphp @empty @endforelse {{-- $warehouse --}}
# Store Date Dealer Group Limit Amount Action
{{strtoupper($zone->name)}}
{{ ($p++) }} {{ $warehouses->where('id',$item->warehouse_id)->first()->name_eng }} {{ date('d-M-Y h:i A',strtotime($item->created_at)) }} {{ $item->showroom?$item->showroom->name_eng:'N\A' }} {{ $item->showroom?($item->showroom->group_id?$groups->where('id',$item->showroom->group_id)->first()->name_eng:'no Group'):'' }} {{ $item->showroom?($item->showroom->limit_apply?$item->showroom->credit_limit_amount:'Not Apply'):'' }}{{ number_format($netTotal,2) }}{{ number_format($item->net_total,2) }} Print @if ($item->delivery_status == 0 && get_guard()=='admin') @if(checkAuthPermission('order.edit')) Edit @endif @endif
{{'Total : '}}{{number_format($wareAmount,2)}}
{{'Grand Total'}}{{number_format($total,2)}}
@endif
@include('inventory.order.detail_modal') @endsection @section('script') @stop