@extends('admin.layout.app') @section('content')

All Restaurant Report

@php $website_count_all = \DB::table('orders')->where(['order_type'=>'website','send'=>1])->count(); $website_amount_all = \DB::table('orders')->where(['order_type'=>'website','send'=>1])->sum('total'); $qr_count_all = \DB::table('orders')->where(['order_type'=>'qrcode','send'=>1])->count(); $qr_amount_all = \DB::table('orders')->where(['order_type'=>'qrcode','send'=>1])->sum('total'); $pos_count_all = \DB::table('orders')->where(['order_type'=>'pos','send'=>1])->count(); $pos_amount_all = \DB::table('orders')->where(['order_type'=>'pos','send'=>1])->sum('total'); $app_count_all = \DB::table('orders')->where(['order_type'=>'app','send'=>1])->count(); $app_amount_all = \DB::table('orders')->where(['order_type'=>'app','send'=>1])->sum('total'); $dinein_count_all = \DB::table('orders')->where(['sub_order_type'=>'Dine In','send'=>1])->count(); $dinein_amount_all = \DB::table('orders')->where(['sub_order_type'=>'Dine In','send'=>1])->sum('total'); $takeway_count_all = \DB::table('orders')->where(['sub_order_type'=>'Take Away','send'=>1])->count(); $takeway_amount_all = \DB::table('orders')->where(['sub_order_type'=>'Take Away','send'=>1])->sum('total'); $delivery_count_all = \DB::table('orders')->where(['sub_order_type'=>'Delivery','send'=>1])->count(); $delivery_amount_all = \DB::table('orders')->where(['sub_order_type'=>'Delivery','send'=>1])->sum('total'); $walkin_count_all = \DB::table('orders')->where(['sub_order_type'=>'Walk In','send'=>1])->count(); $walkin_amount_all = \DB::table('orders')->where(['sub_order_type'=>'Walk In','send'=>1])->sum('total'); $today_count_all = \DB::table('orders')->where(['send'=>1])->whereDate('created_at', \Carbon\Carbon::today())->count(); $today_amount_all = \DB::table('orders')->where(['send'=>1])->whereDate('created_at', \Carbon\Carbon::today())->sum('total'); $all_count_all = \DB::table('orders')->where(['send'=>1])->count(); $all_amount_all = \DB::table('orders')->where(['send'=>1])->sum('total'); $cash_count_all = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.pay_method','Cash')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->count(); $cash_amount_all = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.pay_method','Cash')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->sum('amount'); $card_count_all = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.pay_method','Card')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->count(); $card_amount_all = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.pay_method','Card')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->sum('amount'); $tyro_count_all = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.pay_method','Tyro')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->count(); $tyro_amount_all = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.pay_method','Tyro')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->sum('amount'); $other_count_all = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.pay_method','!=','Card')->where('payment_orders.pay_method','!=','Cash')->where('payment_orders.pay_method','!=','Tyro')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->count(); $other_amount_all = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.pay_method','!=','Card')->where('payment_orders.pay_method','!=','Cash')->where('payment_orders.pay_method','!=','Tyro')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->sum('amount'); @endphp

All Restaurant Record

Today Orders Count : {{@$today_count_all}}
Today Sale Amount : ${{@$today_amount_all}}
Total Order Count : {{@$all_count_all}}
Total Sale Amount : ${{@$all_amount_all}}
Website Count : {{@$website_count_all}} Amount: ${{@$website_amount_all}}
QR Count : {{@$qr_count_all}} Amount: ${{@$qr_amount_all}}
POS Count : {{@$pos_count_all}} Amount: ${{@$pos_amount_all}}
APP Count : {{@$app_count_all}} Amount: ${{@$app_amount_all}}
Cash Count : {{@$cash_count_all}} Amount: ${{@$cash_amount_all}}
Card Count : {{@$card_count_all}} Amount: ${{@$card_amount_all}}
Tyro Count : {{@$tyro_count_all}} Amount: ${{@$tyro_amount_all}}
Other Count : {{@$other_count_all}} Amount: ${{@$other_amount_all}}
DineIn Count : {{@$dinein_count_all}} Amount: ${{@$dinein_amount_all}}
Take Away Count : {{@$takeway_count_all}} Amount: ${{@$takeway_amount_all}}
Delivery Count : {{@$delivery_count_all}} Amount: ${{@$delivery_amount_all}}
WalkIn Count : {{@$walkin_count_all}} Amount: ${{@$walkin_amount_all}}
@foreach($all_business as $business) @php $website_count = \DB::table('orders')->where(['order_type'=>'website','send'=>1,'restaurant'=>$business->reference_market_id])->count(); $website_amount = \DB::table('orders')->where(['order_type'=>'website','send'=>1,'restaurant'=>$business->reference_market_id])->sum('total'); $qr_count = \DB::table('orders')->where(['order_type'=>'qrcode','send'=>1,'restaurant'=>$business->reference_market_id])->count(); $qr_amount = \DB::table('orders')->where(['order_type'=>'qrcode','send'=>1,'restaurant'=>$business->reference_market_id])->sum('total'); $pos_count = \DB::table('orders')->where(['order_type'=>'pos','send'=>1,'restaurant'=>$business->reference_market_id])->count(); $pos_amount = \DB::table('orders')->where(['order_type'=>'pos','send'=>1,'restaurant'=>$business->reference_market_id])->sum('total'); $app_count = \DB::table('orders')->where(['order_type'=>'app','send'=>1,'restaurant'=>$business->reference_market_id])->count(); $app_amount = \DB::table('orders')->where(['order_type'=>'app','send'=>1,'restaurant'=>$business->reference_market_id])->sum('total'); $dinein_count = \DB::table('orders')->where(['sub_order_type'=>'Dine In','send'=>1,'restaurant'=>$business->reference_market_id])->count(); $dinein_amount = \DB::table('orders')->where(['sub_order_type'=>'Dine In','send'=>1,'restaurant'=>$business->reference_market_id])->sum('total'); $takeway_count = \DB::table('orders')->where(['sub_order_type'=>'Take Away','send'=>1,'restaurant'=>$business->reference_market_id])->count(); $takeway_amount = \DB::table('orders')->where(['sub_order_type'=>'Take Away','send'=>1,'restaurant'=>$business->reference_market_id])->sum('total'); $delivery_count = \DB::table('orders')->where(['sub_order_type'=>'Delivery','send'=>1,'restaurant'=>$business->reference_market_id])->count(); $delivery_amount = \DB::table('orders')->where(['sub_order_type'=>'Delivery','send'=>1,'restaurant'=>$business->reference_market_id])->sum('total'); $walkin_count = \DB::table('orders')->where(['sub_order_type'=>'Walk In','send'=>1,'restaurant'=>$business->reference_market_id])->count(); $walkin_amount = \DB::table('orders')->where(['sub_order_type'=>'Walk In','send'=>1,'restaurant'=>$business->reference_market_id])->sum('total'); $today_count = \DB::table('orders')->where(['send'=>1,'restaurant'=>$business->reference_market_id])->whereDate('created_at', \Carbon\Carbon::today())->count(); $today_amount = \DB::table('orders')->where(['send'=>1,'restaurant'=>$business->reference_market_id])->whereDate('created_at', \Carbon\Carbon::today())->sum('total'); $all_count = \DB::table('orders')->where(['send'=>1,'restaurant'=>$business->reference_market_id])->count(); $all_amount = \DB::table('orders')->where(['send'=>1,'restaurant'=>$business->reference_market_id])->sum('total'); $cash_count = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.restaurant_id',$business->reference_market_id)->where('payment_orders.pay_method','Cash')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->count(); $cash_amount = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.restaurant_id',$business->reference_market_id)->where('payment_orders.pay_method','Cash')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->sum('amount'); $card_count = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.restaurant_id',$business->reference_market_id)->where('payment_orders.pay_method','Card')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->count(); $card_amount = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.restaurant_id',$business->reference_market_id)->where('payment_orders.pay_method','Card')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->sum('amount'); $tyro_count = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.restaurant_id',$business->reference_market_id)->where('payment_orders.pay_method','Tyro')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->count(); $tyro_amount = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.restaurant_id',$business->reference_market_id)->where('payment_orders.pay_method','Tyro')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->sum('amount'); $other_count = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.restaurant_id',$business->reference_market_id)->where('payment_orders.pay_method','!=','Card')->where('payment_orders.pay_method','!=','Cash')->where('payment_orders.pay_method','!=','Tyro')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->count(); $other_amount = \DB::table('payment_orders')->join('orders','orders.id','payment_orders.order_id')->where('payment_orders.restaurant_id',$business->reference_market_id)->where('payment_orders.pay_method','!=','Card')->where('payment_orders.pay_method','!=','Cash')->where('payment_orders.pay_method','!=','Tyro')->where(['orders.send'=>1,'orders.status'=>5])->groupBy('pay_method')->sum('amount'); @endphp

{{@$business->name}}

Today Orders Count : {{@$today_count}}
Today Sale Amount : ${{@$today_amount}}
Total Order Count : {{@$all_count}}
Total Sale Amount : ${{@$all_amount}}
Website Count : {{@$website_count}} Amount: ${{@$website_amount}}
QR Count : {{@$qr_count}} Amount: ${{@$qr_amount}}
POS Count : {{@$pos_count}} Amount: ${{@$pos_amount}}
APP Count : {{@$app_count}} Amount: ${{@$app_amount}}
Cash Count : {{@$cash_count}} Amount: ${{@$cash_amount}}
Card Count : {{@$card_count}} Amount: ${{@$card_amount}}
Tyro Count : {{@$tyro_count}} Amount: ${{@$tyro_amount}}
Other Count : {{@$other_count}} Amount: ${{@$other_amount}}
DineIn Count : {{@$dinein_count}} Amount: ${{@$dinein_amount}}
Take Away Count : {{@$takeway_count}} Amount: ${{@$takeway_amount}}
Delivery Count : {{@$delivery_count}} Amount: ${{@$delivery_amount}}
WalkIn Count : {{@$walkin_count}} Amount: ${{@$walkin_amount}}
@endforeach
@endsection