Terima kasih telah memilih {{ @$booking->hotel->nama }} sebagai tempat menginap selama tinggal di {{@$booking->hotel->city}}, seperti dalam persetujuan, berikut kami konfirmasikan reservasi dengan detail :
Nama tamu |
: |
{{ $booking->title }} {{ $booking->nama }} |
Periode |
: |
{{ $period_lists[0]['date'] }} ({{ $group_by_periods[$period_lists[0]['date']]['jumlah_malam'] }} malam) {{ $group_by_periods[$period_lists[0]['date']]['jumlah_kamar'] }} Rooms |
{{-- Periode Extend Stay --}}
@foreach ($period_lists as $key => $period_list)
@if ($key === 0)
@continue
@endif
|
|
{{ $period_list['date'] }} ({{ $group_by_periods[$period_list['date']]['jumlah_malam'] }} malam) {{ $group_by_periods[$period_list['date']]['jumlah_kamar'] }} Rooms |
@endforeach
{{-- Closed Periode Extend Stay --}}
{{--
|
|
{{ formatDate($booking->start_date).' - '.formatDate($booking->end_date) }} ({{ $booking->jml_malam }} malam) {{ $booking->jml_kamar }} Rooms |
--}}
@php
// defined variable with empty array
// group by
$group_by_jenis_kamars = array();
$group_by_rate_codes = array();
$group_by_performa_invoices = array();
// lists
$jenis_kamar_lists = array();
$rate_code_lists = array();
$performa_invoice_lists = array();
// defined variable with 0 value
$total_tagihan_performa_invoice = 0;
// check if booking details is not empty
if (!@$booking->bookingDetails->isEmpty()) {
// foreach booking details for get jenis kamar
foreach ($booking->bookingDetails as $key => $booking_detail) {
// check if array sub value 0
if ($booking_detail->array_sub === 0 || $booking_detail->array_sub_extend_stay === 0) {
// insert value in variable array
$group_by_jenis_kamars[$booking_detail->jenis_kamar_id]['nomor_kamar'][] = $booking_detail->nomor_kamar;
$group_by_jenis_kamars[$booking_detail->jenis_kamar_id]['jenis_kamar'] = $booking_detail->jenis_kamar;
$group_by_rate_codes[$booking_detail->rate_codes]['harga'] = $booking_detail->per_item;
$group_by_performa_invoices[$booking_detail->rate_codes]['harga'] = $booking_detail->per_item - $booking_detail->per_item_arr;
$group_by_performa_invoices[$booking_detail->rate_codes]['jenis_kamars'][$booking_detail->jenis_kamar_id]['jenis_kamar'] = $booking_detail->jenis_kamar;
$group_by_performa_invoices[$booking_detail->rate_codes]['jenis_kamars'][$booking_detail->jenis_kamar_id]['nomor_kamar'][] = $booking_detail->nomor_kamar;
// check if value jenis kamar id not available in jenis kamar lists
if (!in_array($booking_detail->jenis_kamar_id, $jenis_kamar_lists)) {
// insert jenis kamar id in variable array
$jenis_kamar_lists[] = $booking_detail->jenis_kamar_id;
$performa_invoice_lists[$key]['jenis_kamars'] = $booking_detail->jenis_kamar_id;
}
// check if value rate code not available in rate code lists
if (!in_array($booking_detail->rate_codes, $rate_code_lists)) {
// insert rate code in variable array
$rate_code_lists[] = $booking_detail->rate_codes;
$performa_invoice_lists[$key]['rate_code'] = $booking_detail->rate_codes;
}
}
}
}
// dd($performa_invoice_lists, $group_by_performa_invoices);
@endphp
{{-- Single Jumlah kamar --}}
Jumlah Kamar |
: |
{{ count($group_by_jenis_kamars[$jenis_kamar_lists[0]]['nomor_kamar']).' '.$group_by_jenis_kamars[$jenis_kamar_lists[0]]['jenis_kamar']->nama}} |
{{-- Closed Single Jumlah Kamar --}}
{{-- Multiple jumlah kamar --}}
@foreach ($jenis_kamar_lists as $key => $jenis_kamar_list)
@if ($key == 0)
@continue
@endif
|
|
{{ count($group_by_jenis_kamars[$jenis_kamar_lists[$key]]['nomor_kamar']).' '.$group_by_jenis_kamars[$jenis_kamar_lists[$key]]['jenis_kamar']->nama}} |
@endforeach
{{-- Closed Multiple jumlah kamar --}}
@if (!in_array($booking->segmentasi_rate_code, [4, 5]))
{{-- Single Harga Kamar --}}
Harga Kamar |
: |
{{-- Rp. {{ ribuan($group_by_rate_codes[$rate_code_lists[0]]['harga']) }},-nett Room Only | --}}
@if (count(@$harga_kamars)>0)
@foreach ($harga_kamars as $key => $items)
@if ($key == 0)
@else
@endif
@foreach ($items as $k => $item)
@if ($k == 0)
Room {{$key}} . ) Rp. {{ ribuan($item) }},-nett {{@$rate_kamars[$key]}}
@else
Rp. {{ ribuan($item) }},-nett {{@$rate_kamars[$key]}}
@endif
@endforeach
@endforeach
@endif
|
{{-- Closed Single Harga Kamar --}}
{{-- Multiple Harga Kamar --}}
{{-- @foreach ($rate_code_lists as $key => $rate_code_list)
@if ($key == 0)
@continue
@endif
|
|
Rp. {{ ribuan($group_by_rate_codes[$rate_code_lists[$key]]['harga']) }},-nett Room Only |
@endforeach --}}
{{-- Closed Multiple Harga Kamar --}}
@endif
Cara Pembayaran |
: |
{!! $booking->ket_pembayaran ?? '-' !!} |
{{-- Single Performa Invoice --}}
{{-- Non Extend Stay --}}
@if ($invoice_performance_lists[0]['extend_stay'] === 0)
Performa Invoice |
: |
@php
$jumlah_kamar_per_jenis_kamar = $group_by_periods[$invoice_performance_lists[0]['date']]['extend_stay'][0]['jenis_kamars'][$invoice_performance_lists[0]['jenis_kamar_id']]['jumlah_kamar_per_jenis_kamar'];
$jenis_kamar = $group_by_periods[$invoice_performance_lists[0]['date']]['extend_stay'][0]['jenis_kamars'][$invoice_performance_lists[0]['jenis_kamar_id']]['data_jenis_kamar'];
$total_performa_invoice = $group_by_periods[$invoice_performance_lists[0]['date']]['extend_stay'][0]['jenis_kamars'][$invoice_performance_lists[0]['jenis_kamar_id']]['total_harga_rate_code'];
$jumlah_malam = $group_by_periods[$invoice_performance_lists[0]['date']]['jumlah_malam'];
$total_tagihan_performa_invoice += $total_performa_invoice;
@endphp
{{ $jumlah_kamar_per_jenis_kamar.' '.$jenis_kamar->nama}} X {{ $jumlah_malam }} Malam = Rp. {{ribuan($total_performa_invoice)}} |
@endif
{{-- Close Non Extend Stay --}}
{{-- Extend Stay --}}
@if ($invoice_performance_lists[0]['extend_stay'] == 1)
|
|
@php
$jumlah_kamar_per_jenis_kamar = $group_by_periods[$invoice_performance_lists[0]['date']]['extend_stay'][1]['jenis_kamars'][$invoice_performance_lists[0]['jenis_kamar_id']]['jumlah_kamar_per_jenis_kamar'];
$jenis_kamar = $group_by_periods[$invoice_performance_lists[0]['date']]['extend_stay'][1]['jenis_kamars'][$invoice_performance_lists[0]['jenis_kamar_id']]['data_jenis_kamar'];
$total_performa_invoice = $group_by_periods[$invoice_performance_lists[0]['date']]['extend_stay'][1]['jenis_kamars'][$invoice_performance_lists[0]['jenis_kamar_id']]['total_harga_rate_code'];
$jumlah_malam = $group_by_periods[$invoice_performance_lists[0]['date']]['jumlah_malam'];
$total_tagihan_performa_invoice += $total_performa_invoice;
@endphp
{{ $jumlah_kamar_per_jenis_kamar.' '.$jenis_kamar->nama}} X {{ $jumlah_malam }} Malam = Rp. {{ribuan($total_performa_invoice)}} |
@endif
{{-- Close Extend Stay --}}
{{-- Closed Single Performa Invoice--}}
{{-- Multiple Performa Invoice --}}
@foreach ($invoice_performance_lists as $key_invoice_performance_list => $invoice_performance_list)
@if ($key_invoice_performance_list == 0)
@continue
@endif
@if ($invoice_performance_list['extend_stay'] == 0)
{{-- Non Extend Stay --}}
|
|
@php
$jumlah_kamar_per_jenis_kamar = $group_by_periods[$invoice_performance_list['date']]['extend_stay'][$invoice_performance_list['extend_stay']]['jenis_kamars'][$invoice_performance_list['jenis_kamar_id']]['jumlah_kamar_per_jenis_kamar'];
$jenis_kamar = $group_by_periods[$invoice_performance_list['date']]['extend_stay'][$invoice_performance_list['extend_stay']]['jenis_kamars'][$invoice_performance_list['jenis_kamar_id']]['data_jenis_kamar'];
$total_performa_invoice = $group_by_periods[$invoice_performance_list['date']]['extend_stay'][$invoice_performance_list['extend_stay']]['jenis_kamars'][$invoice_performance_list['jenis_kamar_id']]['total_harga_rate_code'];
$jumlah_malam = $group_by_periods[$invoice_performance_list['date']]['jumlah_malam'];
$total_tagihan_performa_invoice += $total_performa_invoice;
@endphp
{{ $jumlah_kamar_per_jenis_kamar.' '.$jenis_kamar->nama}} X {{ $jumlah_malam }} Malam = Rp. {{ribuan($total_performa_invoice)}} |
{{-- Close Non Extend Stay --}}
@endif
@if ($invoice_performance_list['extend_stay'] == 1)
{{-- Extend Stay --}}
|
|
@php
$jumlah_kamar_per_jenis_kamar = $group_by_periods[$invoice_performance_list['date']]['extend_stay'][$invoice_performance_list['extend_stay']]['jenis_kamars'][$invoice_performance_list['jenis_kamar_id']]['jumlah_kamar_per_jenis_kamar'];
$jenis_kamar = $group_by_periods[$invoice_performance_list['date']]['extend_stay'][$invoice_performance_list['extend_stay']]['jenis_kamars'][$invoice_performance_list['jenis_kamar_id']]['data_jenis_kamar'];
$total_performa_invoice = $group_by_periods[$invoice_performance_list['date']]['extend_stay'][$invoice_performance_list['extend_stay']]['jenis_kamars'][$invoice_performance_list['jenis_kamar_id']]['total_harga_rate_code'];
$jumlah_malam = $group_by_periods[$invoice_performance_list['date']]['jumlah_malam'];
$total_tagihan_performa_invoice += $total_performa_invoice;
@endphp
{{ $jumlah_kamar_per_jenis_kamar.' '.$jenis_kamar->nama}} X {{ $jumlah_malam }} Malam = Rp. {{ribuan($total_performa_invoice)}} |
{{-- Close Extend Stay --}}
@endif
@endforeach
{{-- Closed Multiple Performa Invoice--}}
Total Tagihan |
: |
Rp. {{ ribuan($total_tagihan_performa_invoice) }} |