@extends('admin.layout.master') @section('custom_style') @endsection @section('content')
@include('frontdesk.report.report_header') @include('frontdesk.allotments.allotment_agent_info')
{{__('obs.allotment_information')}}
@if($info->version == 1) @endif @php $total = 0; $colspan = 3; @endphp @if($info->version == 0) @foreach ($allotted_room_types as $key=>$t) @php $total += ($t->qty*$info->total_night*$info->rate); @endphp @endforeach @else @php $colspan = 5; @endphp @foreach ($info->fd_allotment_details as $key=>$t) @php $row_t = ($t->qty*$info->total_night*$t->rate); $total += $row_t; @endphp @endforeach @endif @php // round(calculate_tax($total,$info->get_tax_info->sum('tax_percent'),$info->tax_type,$info->get_tax_info->sum('tax_percent')),2); $vatPercent = $info->get_tax_info->where('tax_id', getVATId())->first()->tax_percent; $baladyPercent = $info->get_tax_info->where('tax_id', getBaladyId())->first()->tax_percent; $taxCalRes = calculateKSAHotelTaxes($total, $info->tax_type, $vatPercent, $baladyPercent); $balady_amount = $taxCalRes['balady']; $vat_amount = $taxCalRes['vat']; $without_vat = $taxCalRes['base']; @endphp @if($balady_amount > 0) @endif @if($vat_amount > 0) @endif
{{__('obs.sl')}} {{__('obs.room_type')}} {{ __('obs.room_no') }} {{__('obs.room_qty')}}{{ __('obs.rate') }} {{ __('obs.total') }}
{{ $key+1 }} {{ $t->room_type }} {{ implode(', ', $info->get_rooms->pluck('get_room')->where('room_type', $t->room_type_id)->flatten(1)->pluck('room_number')->toArray()) }} {{ $t->qty }}
{{ $key+1 }} {{ $t->room_type->name ?? "" }} @php $allotted_room_ids = explode(',', $t->room_ids); @endphp @foreach ($allotted_room_ids as $r) {{ $rooms_when_create[$r] ?? "" }} @if($loop->last == false), @endif @endforeach {{ $t->qty }} {{ $t->rate }}{{ $row_t }}
{{__('obs.total')}} {{ $total }}
{{__('obs.without_vat')}} {{ number_format($without_vat, 2) }}
{{__('obs.balady')}} ({{ $baladyPercent }}%) {{ number_format($balady_amount, 2) }}
{{__('obs.vat')}} ({{ $vatPercent }}%) {{ number_format($vat_amount,2) }}
{{__('obs.grand_total')}} {{ number_format($without_vat+$vat_amount+$balady_amount,2) }}
@if(count($commissions) > 0)
{{__('obs.commission_through_check_in')}}
@foreach ($commissions as $c) @endforeach
{{ __('obs.sl') }} {{ __('obs.check_in_code') }} {{ __('obs.amount') }}
{{ $loop->iteration }} {{ $c->reservation->checkin_code ?? '' }} {{ $c->amount }}
{{__('obs.total')}} {{ $commissions->sum('amount') }}
@endif @if(count($info->get_replace_history) > 0 && false) @include('frontdesk.allotments.room_replace_history_body') @endif @if(count($info->get_allotment_release) > 0)
{{__('obs.allotment_room_release_history')}}
@foreach ($info->get_allotment_release as $key=>$i) @endforeach
{{ __('obs.sl') }} {{ __('obs.from') }} {{ __('obs.to') }} {{ __('obs.total_night') }} {{ __('obs.no_of_rooms') }} {{ __('obs.rooms') }}
{{ $key+1 }} {{ date('d-m-Y', strtotime($i->start_date)) }} {{ date('d-m-Y', strtotime($i->end_date)) }} {{ $i->night }} {{ $i->qty }} {{ implode(', ', $fd_rooms->whereIn('id', json_decode($i->room_ids))->pluck('room_number')->toArray()) }}
@endif
{{__('obs.installment_information')}}
@php $total = 0; @endphp @foreach ($info->fd_allotment_installments as $key=>$d) @endforeach
{{__('obs.sl')}} {{__('obs.date')}} {{__('obs.amount')}}
{{ $key+1 }} {{ date('d-m-Y', strtotime($d->date)) }} {{ $d->amount }}
Total {{ $info->fd_allotment_installments->sum('amount') }}
@if(count($info->getReceive) > 0) @php $sl = 0 @endphp
{{__('obs.receive')}}
@foreach ($info->getReceive->groupBy('fd_invoice_id') as $r) @endforeach
{{ __('obs.sl') }} {{ __('obs.date') }} {{ __('obs.payment_mode') }} {{ __('obs.discount') }} {{ __('obs.amount') }} {{ __('obs.note') }}
{{ ++$sl }} {{ date('d-m-Y', strtotime($r->first()->date)) }} {{ $r->whereNotIn('ledger_id', $commission_discount_ledger)->first()->accounts_head->name ?? '' }} {{ $r->whereIn('ledger_id', $commission_discount_ledger)->sum('amount') }} {{ $r->whereNotIn('ledger_id', $commission_discount_ledger)->sum('amount') }} {{ $r->first()->fd_invoice->note ?? '' }}
Total {{ $info->getReceive->whereIn('ledger_id', $commission_discount_ledger)->sum('amount') }} {{ $info->getReceive->whereNotIn('ledger_id', $commission_discount_ledger)->sum('amount') }}
@endif
@php $gt_c = $taxCalRes['total'] + $commissions->sum('amount') - $info->getReceive->sum('amount'); @endphp @if(count($commissions) > 0) @endif
{{__('obs.total_bill')}} {{ $taxCalRes['total'] }}
{{__('obs.commission_through_check_in')}} {{ $commissions->sum('amount') }}
{{__('obs.received')}} {{ $info->getReceive->sum('amount') }}
{{__('obs.due')}} {{ $gt_c }}
@php $key=0; $added_terms = isset($info) ? explode(',',$info->booking_terms) : []; $custom_terms = isset($info) ? explode('*|*',$info->custom_terms) : []; $added_terms = array_filter($added_terms); $custom_terms = array_filter($custom_terms); @endphp @if(count($added_terms) > 0 || count($custom_terms) > 0)
{{__('obs.terms')}}
    @foreach (getTerms() as $t) @if (in_array($t->ref_id, [7, $term_type]) && in_array($t->ref_id, [7, $added_terms]) && $t->is_printable == 1)
  1. {{ $t->name }}
  2. @endif @endforeach @foreach ($custom_terms as $t)
  3. {{ $t }}
  4. @endforeach
@endif
@endsection