@php $settings = getSettings(); @endphp {{$settings['site_page_title']}}: {{lang_trans('txt_invoice')}} @php $i = 0; $totalOrdersAmount = 0; $itemsQty = []; $orderedItemsArr = []; if($data_row->orders_items){ foreach($data_row->orders_items as $k=>$val){ $jsonData = json_decode($val->json_data); $itemId = $jsonData->item_id; if(isset($itemsQty[$itemId])){ $itemsQty[$itemId] = $itemsQty[$itemId]+$val->item_qty; } else { $itemsQty[$itemId] = $val->item_qty; } $orderedItemsArr[$itemId] = [ 'item_name'=>$val->item_name, 'item_qty'=>$itemsQty[$itemId], 'item_price'=>$val->item_price, 'amount'=>$itemsQty[$itemId]*$val->item_price, 'created_at'=>dateConvert($val->created_at,'d-m-Y'), ]; } } $roomNumbers = []; if($data_row->reservation_data){ if($data_row->reservation_data->booked_rooms){ foreach ($data_row->reservation_data->booked_rooms as $key => $value) { if($value->swapped_from_room === null && $value->room){ $roomNumbers[] = $value->room->room_no; } } } } @endphp
{{--
{{lang_trans('txt_gstin')}}: {{$settings['gst_num']}}
--}} {{--
{{lang_trans('txt_ph')}} {{$settings['hotel_phone']}}
({{lang_trans('txt_mob')}}) {{$settings['hotel_mobile']}}
--}}
{{$settings['hotel_name']}}
{{$settings['hotel_tagline']}}
{{$settings['hotel_address']}}
{{$settings['hotel_website']}} | {{lang_trans('txt_email')}}:- {{$settings['hotel_email']}}
{{lang_trans('txt_num')}} {{ ($data_row->table_num) ? lang_trans('txt_table_num') : lang_trans('txt_room_num')}} {{lang_trans('txt_dated')}}
{{$data_row->invoice_num}} {{ ($data_row->table_num) ? $data_row->table_num : implode(', ', $roomNumbers)}} {{dateConvert($data_row->invoice_date,'d-m-Y')}}
{{lang_trans('txt_cust_name')}}:
{{$data_row->name}}
{{lang_trans('txt_address')}}:
{{$data_row->address}}
{{lang_trans('txt_waiter')}}:
{{$data_row->waiter_name}}
@forelse($orderedItemsArr as $k=>$val) @php $totalOrdersAmount = $totalOrdersAmount + ($val['item_qty']*$val['item_price']); @endphp @empty @endforelse @php $gstPerc = $cgstPerc = $discount = 0; if($data_row->gst_apply==1){ $gstPerc = $data_row->gst_perc; $cgstPerc = $data_row->cgst_perc; } $discount = ($data_row->discount>0) ? $data_row->discount : 0; $gst = gstCalc($totalOrdersAmount,'food_amount',$gstPerc,$cgstPerc); $foodAmountGst = $gst['gst']; $foodAmountCGst = $gst['cgst']; @endphp @if($foodAmountGst>0) @endif @if($foodAmountCGst>0) @endif @if($discount>0) @endif @php $finalFoodAmount = numberFormat($totalOrdersAmount+$foodAmountGst+$foodAmountCGst-$discount); @endphp
{{lang_trans('txt_sno')}} {{lang_trans('txt_item_details')}} {{lang_trans('txt_item_qty')}} {{lang_trans('txt_item_price')}} ({{getCurrencySymbol()}}) {{lang_trans('txt_amount')}} ({{getCurrencySymbol()}})
{{++$i}}. {{$val['item_name']}} {{$val['item_qty']}} {{$val['item_price']}} {{$val['item_qty']*$val['item_price']}}
{{lang_trans('txt_no_orders')}}
{{lang_trans('txt_total')}} {{getCurrencySymbol()}} {{ numberFormat($totalOrdersAmount) }}
{{lang_trans('txt_gst')}} ({{$gstPerc}} %) {{getCurrencySymbol()}} {{ numberFormat($foodAmountGst) }}
{{lang_trans('txt_cgst')}} ({{$cgstPerc}} %) {{getCurrencySymbol()}} {{ numberFormat($foodAmountCGst) }}
{{lang_trans('txt_discount')}} {{getCurrencySymbol()}} {{ numberFormat($discount) }}
{{lang_trans('txt_grand_total')}} {{getCurrencySymbol()}} {{ numberFormat($finalFoodAmount) }}
{{lang_trans('txt_amount_words')}}:- {{ getIndianCurrency(numberFormat($finalFoodAmount)) }}
{{lang_trans('txt_customer_sign')}}
{{lang_trans('txt_manager_sign')}}