@extends(\Auth::user()->role != 10 ? 'layout' : 'layoutfrontdesk') @section('title', 'Guest Account Balance') @section('css') @endsection @section('content')
{{-- Room sales --}}
{{--
@csrf
--}}
@if(count($bills) > 0) @php $idx = 1; $total_prev_balance = 0; $total_debit = 0; $total_edit = 0; $total_balance = 0; //$debit_summaries = array(); //$edit_summaries = array(); //$balance_summaries = array(); $summaries = array(); @endphp @foreach($bills as $no_bill => $bill) @php $index_bill = 0; $balance = 0; $bill_balance = 0; @endphp @foreach($bill as $key => $item_bill) {{-- @if($item_bill->booking_detail_id) @php $total = $item_bill->total; @endphp @endif @if($item_bill->invoice_id && $item_bill->menu_id) @php $total = $item_bill->grand_total; @endphp @endif @if($item_bill->jenis_deposit) @php $total = $item_bill->nominal * -1 @endphp @endif @if($item_bill->jenis_pembayaran_id) @endif --}} @php $bill_balance = $balance; $index_bill++; $idx++; @endphp @endforeach @php $total_balance += $bill_balance; @endphp @endforeach @else @endif @if(count($bills) > 0) @php $total_summary_debit = 0; $total_summary_credit = 0; @endphp @foreach($summaries as $key => $summary) @php $total_summary_credit += array_sum($summary['credit']); $total_summary_debit += array_sum($summary['debit']); @endphp @endforeach {{-- @foreach($edit_summaries as $key => $edit_summary) @endforeach --}} @endif
Name RmNo BillNo Description Prev Balance Debit Credit Balance Arrival Transaction Date
{{ $index_bill == 0 ? $item_bill['name'] : '' }} {{ $index_bill == 0 ? $item_bill['rmno'] : '' }} {{ $index_bill == 0 ? $item_bill['billno'] : '' }} {{ $item_bill['description'] }} {{ ribuanWithComma(array_sum($item_bill['prev_balance'])) }} @php $total_prev_balance += array_sum($item_bill['prev_balance']); @endphp {{ ribuanWithComma(array_sum($item_bill['debit'])) }} @php $total_debit += array_sum($item_bill['debit']); $summaries[$key]['label'] = $item_bill['description']; $summaries[$key]['debit'][] = array_sum($item_bill['debit']); @endphp {{ ribuanWithComma(array_sum($item_bill['credit']) * -1) }} @php $total_edit += array_sum($item_bill['credit']); $summaries[$key]['credit'][] = array_sum($item_bill['credit']) * -1; @endphp @php $balance += array_sum($item_bill['prev_balance']) + array_sum($item_bill['debit']) + array_sum($item_bill['credit']); $bill_balance += $balance; @endphp {{ ribuanWithComma($balance) }} {{ $item_bill['arrival'] }} {{ $item_bill['departure'] }} {{ $item_bill['transaction_date'] }}
{{ $index_bill == 0 ? @$item_bill->invoice->nama_pelanggan : '' }} {{ $index_bill == 0 ? $item_bill->room_no : '' }} {{ $no_bill ?? '' }} {{ $item_bill->description }} @if(strtotime($item_bill->date) < strtotime($date)) {{ribuanWithComma($total)}} @php $balance += $total; $total_prev_balance += $total; @endphp @else 0 @endif @if(date('Y-m-d', strtotime($item_bill->date)) == $date) {{ribuanWithComma($total)}} @php $balance += $total; $total_debit += $total; $debit_summaries[$item_bill->description][] = $item_bill->total; $balance_summaries[$item_bill->description][] = $total; @endphp @else 0 @endif 0 {{ ribuanWithComma($balance) }} {{ @$item_bill->bookingDetail->start_date ? date('d-m-Y', strtotime($item_bill->bookingDetail->start_date)) : '' }} @if($index_bill == 0) {{ @$item_bill->bookingDetail->end_date ? date('d-m-Y', strtotime($item_bill->bookingDetail->end_date)) : '' }} @endif {{ formatDate($item_bill->date) }}
{{ $index_bill == 0 ? @$item_bill->main_invoice->nama_pelanggan : '' }} {{ $index_bill == 0 ? @$item_bill->kamar->no_kamar : '' }} {{ $no_bill ?? '' }} {{ @$item_bill->menu->nama }} @if(strtotime($item_bill->transaction_date) < strtotime($date)) {{ribuanWithComma($total)}} @php $balance += $total; $total_prev_balance += $total; @endphp @else 0 @endif @if(date('Y-m-d', strtotime($item_bill->transaction_date)) == $date) {{ ribuanWithComma($total) }} @php $balance += $total; $total_debit += $total; $debit_summaries[$item_bill->menu->nama][] = $item_bill->grand_total; $balance_summaries[$item_bill->menu->nama][] = $total; @endphp @else 0 @endif 0 {{ribuanWithComma($balance)}} {{ @$item_bill->main_invoice->bookings->start_date ? date('d-m-Y', strtotime($item_bill->main_invoice->bookings->start_date)) : '' }} @if($index_bill == 0) {{ @$item_bill->main_invoice->bookings->end_date ? date('d-m-Y', strtotime($item_bill->main_invoice->bookings->end_date)) : '' }} @endif {{ formatDate($item_bill->transaction_date) }}
{{ $index_bill == 0 ? @$item_bill->booking->nama : '' }} {{ $index_bill == 0 ? @$invoice_array[$item_bill->booking_id][$item_bill->nomor_kamar]->nomor_kamar : '' }} {{ $no_bill ?? '' }} @if($item_bill->deposit_reservasi) Pembayaran Deposit Reservasi A.N. {{ $item_bill->nama }} @else Pembayaran {{ @config('custom.jenis_deposit')[$item_bill->jenis_deposit].' '.$item_bill->bank }} A.N. {{ $item_bill->nama }} @endif @if(strtotime($item_bill->transaction_date) < strtotime($date)) {{ ribuanWithComma($total) }} @php $balance += $total; $total_prev_balance += $total; @endphp @else 0 @endif 0 @if(date('Y-m-d', strtotime($item_bill->transaction_date)) == $date) {{ ribuanWithComma($item_bill->nominal) }} @php $balance += $total; $total_edit += $total; if($item_bill->deposit_reservasi){ $edit_summaries['Deposit Reservasi'][] = $item_bill->nominal; $balance_summaries['Deposit Reservasi'][] = $total; } else{ $edit_summaries[ config('custom.jenis_pembayaran')[$item_bill->jenis_deposit] ][] = $item_bill->nominal; $balance_summaries[ config('custom.jenis_pembayaran')[$item_bill->jenis_deposit] ][] = $total; } @endphp @else 0 @endif {{ ribuanWithComma($balance )}} {{ @$item_bill->booking->start_date ? date('d-m-Y', strtotime($item_bill->booking->start_date)) : '' }} @if($index_bill == 0) {{ @$item_bill->booking->end_date ? date('d-m-Y', strtotime($item_bill->booking->end_date)) : '' }} @endif {{ formatDate($item_bill->transaction_date) }}
{{ $index_bill == 0 ? @$item_bill->booking->nama : '' }} {{ $index_bill == 0 ? @$invoice_array[$item_bill->booking_id][$item_bill->nomor_kamar]->nomor_kamar : '' }} {{ $no_bill ?? '' }} {{ $item_bill->tipe_pembayaran == 1 ? 'Pembayaran' : 'Refund'}} {{ config('custom.jenis_pembayaran')[$item_bill->jenis_pembayaran_id].' '.$item_bill->bank }} A.N. {{ $item_bill->booking->nama }} @if($item_bill->tipe_pembayaran == 1) @php $total = $item_bill->nominal * -1; @endphp @if(strtotime($item_bill->transaction_date) < strtotime($date)) {{ribuanWithComma($total)}} @php $balance += $total; $total_prev_balance += $total; @endphp @else 0 @endif @else @php $total = $item_bill->nominal; @endphp @if(date('Y-m-d', strtotime($item_bill->transaction_date)) == $date_before) {{ ribuanWithComma($total) }} @php $balance += $total; $total_prev_balance += $total; @endphp @else 0 @endif @endif 0 @if(date('Y-m-d', strtotime($item_bill->transaction_date)) == $date) {{ribuanWithComma($item_bill->nominal)}} @php $balance += $total; $total_edit += $total; $edit_summaries[config('custom.jenis_pembayaran')[$item_bill->jenis_pembayaran_id]][] = $item_bill->nominal; $balance_summaries[config('custom.jenis_pembayaran')[$item_bill->jenis_pembayaran_id]][] = $total; @endphp @else 0 @endif {{ribuanWithComma($balance)}} {{ @$item_bill->booking->start_date ? date('d-m-Y', strtotime($item_bill->booking->start_date)) : '' }} @if($index_bill == 0) {{ @$item_bill->booking->end_date ? date('d-m-Y', strtotime($item_bill->booking->start_date)) : '' }} @endif {{ formatDate($item_bill->transaction_date) }}

Tidak Ada Transaksi Hari Ini

Total {{ribuanWithComma($total_prev_balance)}} {{ribuanWithComma($total_debit)}} {{ribuanWithComma($total_edit * -1)}} {{ribuanWithComma($total_balance)}}
Outstanding {{ribuanWithComma($total_balance)}}
Stored Guest Ledger Amount {{ $stored_guest_ledger ? ribuanWithComma($stored_guest_ledger->amount) : ribuanWithComma($total_balance) }}
Summary Of Transaction
{{ $summary['label'] }} {{ ribuanWithComma(array_sum($summary['debit'])) }} {{ ribuanWithComma(array_sum($summary['credit'])) }} {{ ribuanWithComma(array_sum($summary['debit']) - array_sum($summary['credit'])) }}
Total {{ ribuanWithComma($total_summary_debit) }} {{ ribuanWithComma($total_summary_credit) }} {{ ribuanWithComma($total_summary_debit - $total_summary_credit) }}
{{ $key }} {{ ribuanWithComma(array_sum($edit_summary)) }} {{ ribuanWithComma(array_sum($balance_summaries[$key])) }}
@endsection @section('js') @endsection