@extends('layouts.master_backend') @section('content')

{{lang_trans('heading_filter_orders')}}

{{ Form::open($search_data,array('url'=>route('search-orders'),'id'=>"search-orders", 'class'=>"form-horizontal form-label-left")) }}
{{Form::select('order_type',config('constants.LIST_ORDER_TYPES'),null,['class'=>"form-control"])}}
{{Form::text('date_from',null,['class'=>"form-control datepicker", 'placeholder'=>lang_trans('ph_date_from')])}}
{{Form::text('date_to',null,['class'=>"form-control datepicker", 'placeholder'=>lang_trans('ph_date_to')])}}

{{ Form::close() }}

{{lang_trans('heading_all_orders')}}


@foreach($datalist as $key=>$value) @php $totalOrdersAmount = $finalOrderAmount = 0; $totalOrderAmountGst = $totalOrderAmountCGst = $totalOrderAmountDiscount = $orderGst = $orderCGst = 0; $orderInfo = $value; if($orderInfo){ $orderGst = $orderInfo->gst_perc; $orderCGst = $orderInfo->cgst_perc; $totalOrderAmountGst = $orderInfo->gst_amount; $totalOrderAmountCGst = $orderInfo->cgst_amount; $totalOrderAmountDiscount = $orderInfo->discount; } $countOrderHistory = ($value->order_history) ? $value->order_history->count() : 0; $reservationId = $value->reservation_id; $name = $value->name; $email = $value->email; $mobile = $value->mobile; $checkOutDate = ''; if($reservationId>0){ if($value->reservation_data){ if($value->reservation_data->customer){ $name = $value->reservation_data->customer->name; $email = $value->reservation_data->customer->email; $mobile = $value->reservation_data->customer->mobile; $checkOutDate = $value->reservation_data->check_out; } } $type = lang_trans('txt_room_order'); } else { $type = lang_trans('txt_tbl_order'); } @endphp @endforeach
{{lang_trans('txt_sno')}} {{lang_trans('txt_order_by')}} {{lang_trans('txt_inv_num')}} {{lang_trans('txt_tbl_room_num')}} {{lang_trans('txt_customer_name')}} {{lang_trans('txt_customer_email')}} {{lang_trans('txt_customer_mobile')}} {{lang_trans('txt_order_date')}} {{lang_trans('txt_pay_date')}} {{lang_trans('txt_order_list')}} {{lang_trans('txt_total_amount')}}
{{$key+1}} {{$type}} {{$value->invoice_num}} {{($value->reservation_data!=null) ? $value->reservation_data->room_num : $value->table_num }} {{$name}} {{$email}} {{$mobile}} {{dateConvert($value->created_at,'d-m-Y H:i')}} {{ ($value->original_date!=null) ? dateConvert($value->original_date,'d-m-Y H:i') : 'NA'}} {{-- @if($value->reservation_data==null) --}} {{lang_trans('txt_invoice')}} {{-- @endif --}}
@forelse($value->orders_items as $k=>$val) @php $totalOrdersAmount = $totalOrdersAmount + ($val->item_qty*$val->item_price); $finalOrderAmount = ($totalOrdersAmount+$totalOrderAmountGst+$totalOrderAmountCGst-$totalOrderAmountDiscount); $flag = false; if(Auth::user()->role_id==1){ if($reservationId>0){ if($checkOutDate=='' & $checkOutDate==null){ $flag = true; } } else if($countOrderHistory>0){ $flag = true; } } @endphp @empty @endforelse
{{lang_trans('txt_sno')}} {{lang_trans('txt_item_details')}} {{lang_trans('txt_item_qty')}} {{lang_trans('txt_item_price')}} {{lang_trans('txt_subtotal')}} {{lang_trans('txt_date')}} {{lang_trans('txt_action')}}
{{$k+1}} {{$val->item_name}} {{$val->item_qty}} {{getCurrencySymbol()}} {{$val->item_price}} {{getCurrencySymbol()}} {{$val->item_qty*$val->item_price}} {{dateConvert($val->created_at,'d-m-Y H:i')}} @if($flag) @else @endif
{{lang_trans('txt_no_orders')}}
{{lang_trans('txt_total_amount')}} {{getCurrencySymbol()}} {{numberFormat($finalOrderAmount)}}
{{getCurrencySymbol()}} {{numberFormat($finalOrderAmount)}}
@endsection