@php $spcCustomer = \DB::table('oc_customer_ref')->select('customer_id')->whereIn('warehouse_id', $pos_id)->get(); foreach ($spcCustomer as $key => $value) { $spsCustomersCollection[] = $value->customer_id; } $spscount = \DB::table('oc_plan_to_customer')->where('current',1) ->where('status',1)->whereBetween('start_date', [$startdate, $enddate])->whereIn('customer_id', $spsCustomersCollection)->count(); @endphp
Total SPS :
@if($filterby != 'month') @endif @if(!empty($orders)) @php $gtotalCash = $gtotalQty = $gtotalbill = $gtotalmrp = $gtotalsps = $gtotalOffer = $gtotalvocher = $gotherOffer = $gtotalreward = $gtotal = $gtotalbill0 = $gtotalbill15 = $gtotalbill25 = $gtotalbill5 = $gtotalbill7 = $gtotalbill10 = $gtotalSuits = $gtotalBottom = $gtotalacceess = $gtotaljewelery = $gtotalSPSNew = $gtotalSPSOld = $averaguabv = $averagasp = $averagupt = $gtotalSPS = $abv = $asp = 0.00; $totalCount = count($orders); @endphp @foreach($orders as $key => $order) @php $totalTotal = $otherOffer = $clearence = 0; $totalTotal += $order['totalCash'] + $order['totalCard'] + $order['totalUpi'] + $order['totalWallet'] + $order['totalCn'] + $order['totalGv'] ; $gtotalQty += $order['totalQty']; $gtotalSPS += $order['spscount']; $gtotalSPSNew += $order['newspsbill']; $gtotalSPSOld += $order['oldspsbill']; $gtotalbill += $order['totalBill']; $gotherOffer += $order['otherOffer']; $gtotalOffer += $order['clearence']; $averagupt += $order['upt']; if($order['totalBill'] > 0) { $abv = $totalTotal / $order['totalBill']; } $averaguabv += $abv; if($order['totalQty'] > 0) { $asp = $totalTotal / $order['totalQty']; } $averagasp += $asp; $gtotalmrp += $order['totalMrp']; $gtotalsps += $order['totalSpsDiscount']; $gtotalvocher += $order['voucher']; $gtotalreward += $order['totalreward']; $gtotal += $totalTotal; $gtotalbill5 += $order['bill5']; $gtotalbill7 += $order['bill7']; $gtotalbill10 += $order['bill10']; $gtotalbill0 += $order['bill0']; $gtotalbill15 += $order['bill15']; $gtotalbill25 += $order['bill25']; $gtotalSuits += $order['Suits']; $gtotalBottom += $order['Bottom']; $gtotalacceess += $order['acceess']; $gtotaljewelery += $order['jewelery']; @endphp @if($filterby != 'month') @endif @endforeach @if($filterby != 'month') @endif @php $aupt=$averagupt/$totalCount; $aabv=$averaguabv/$totalCount; $aasp=$averagasp/$totalCount; @endphp @endif
DateDay Store Location Foot fall Repeat New Total NOB QTY UPT ABV ASP Target SPS MRP SPS Discount Clearence Discount Other Offer Discount Gift Vouchers Reward Points Realised sale ACH% CONV% 0 - 1499 1500 - 2499 2500 - 4999 4999 - 7499 7500 - 9999 10000 above Upper Suit Sets Bottom Home Accessory Jewellery
{{$order['date']}}{{date('l', strtotime($order['date']))}}{{$order['store']}} 0 0 0 {{$order['totalBill']}} {{$order['totalQty']}} {{ number_format((float)$order['upt'], 3, '.', '') }} {{ number_format((float)$abv, 3, '.', '') }} {{ number_format((float)$asp, 3, '.', '') }} 0 {{$order['spscount']}} {{$order['totalMrp']}} {{$order['totalSpsDiscount']}} {{$order['clearence']}} {{$order['otherOffer']}} {{$order['voucher']}} {{$order['totalreward']}} {{$totalTotal}} 0 0 {{$order['bill0']}} {{$order['bill15']}} {{$order['bill25']}} {{$order['bill5']}} {{$order['bill7']}} {{$order['bill10']}} 0 {{!empty($order['Suits']) ? $order['Suits'] : 0 }} {{ !empty($order['Bottom']) ? $order['Bottom'] : 0 }} 0 {{!empty($order['acceess']) ? $order['acceess'] :0 }} {{ !empty($order['jewelery']) ? $order['jewelery'] : 0 }}
0 0 0 {{$gtotalbill}} {{$gtotalQty}} {{ round($aupt) }} {{ round($aabv) }} {{ round($aasp) }} 0 {{ round($gtotalSPS) }} {{ round($gtotalmrp) }} {{ round($gtotalsps) }} {{ round($gtotalOffer) }} {{ round($gotherOffer)}} {{round($gtotalvocher)}} {{ round($gtotalreward)}} {{ round($gtotal)}} 0 0 {{round($gtotalbill0) }} {{round($gtotalbill15) }} {{round($gtotalbill25) }} {{round($gtotalbill5)}} {{ round($gtotalbill7)}} {{ round($gtotalbill10)}} 0 {{ round($gtotalSuits)}} {{ round($gtotalBottom)}} 0 {{round($gtotalacceess)}} {{ round($gtotaljewelery)}}