@php
$idx_item = 0;
$refunds = array();
@endphp
@if(count($invoice_details) > 0 || count($booking_deposits) > 0 || count($tambahan) > 0)
{{-- Fetch Data Transaksi Yang Sudah Masuk Invoice Detail --}}
@if (!in_array(@$invoice_titles->bookings->segmentasi_rate_code, ['10', '11']))
@if($invoice_details)
@foreach ($invoice_details as $key=>$invoice_detail)
{{-- BOOKING DETAIL --}}
@if($invoice_detail->booking_detail_id)
@if ($invoice_detail->total != 0)
@php
$diskon = null;
$tipediskon = null;
$this_harga_normal = 0;
if(@$invoice_detail->bookingDetail){
$diskontipe = @$invoice_detail->bookingDetail->disctype;
$tipediskon = @$diskontipe;
$diskon = @$invoice_detail->bookingDetail->diskon;
if ($diskontipe == 1) {
$this_calculate = 100/(100-$diskon)*@$invoice_detail->total;
$this_harga_normal = $this_calculate;
}else{
$this_harga_normal = $diskon+@$invoice_detail->total;
}
}
@endphp
@if(($invoice_detail->jenis_transaksi == 1))
@endif
Generate | System
{{date('d-m-Y', strtotime($invoice_detail->date))}}
{{$invoice_detail->room_no}}
1
{{$invoice_detail->description}}
{{-- {{ribuan($invoice_detail->harga_satuan)}} --}}
{{ribuanWithComma($invoice_detail->harga_satuan)}} {!! $diskon ? ($tipediskon == 1 ? ' (Diskon '.$diskon.'% x '.ribuanWithComma($this_harga_normal).')' : ' ('.ribuanWithComma($this_harga_normal).' - ( '.ribuanWithComma($diskon).' diskon) )' ) : '' !!}
{{-- {{ribuan($invoice_detail->total)}} --}}
{{ribuanWithComma($invoice_detail->total)}}
@if ($invoice_detail->jenis_transaksi == 1)
@php $balance_due += $invoice_detail->total; @endphp
@endif
@if (\Auth::user()->isAdmin())
@endif
{{-- @if (simpleBill())
Tax
{{ @$invoice_detail->bookingDetail ? ribuanWithComma($invoice_detail->bookingDetail->per_item_tax) : '-' }}
Service
{{ @$invoice_detail->bookingDetail ? ribuanWithComma($invoice_detail->bookingDetail->per_item_services) : '-' }}
Real Price
{{ @$invoice_detail->bookingDetail ? ribuanWithComma($invoice_detail->bookingDetail->per_item_real) : '-' }}
@endif --}}
@endif
{{-- SHOP TRANSACTION --}}
@elseif($invoice_detail->shop_transaction_id)
@php
$harga_satuan = $invoice_detail->qty ? $invoice_detail->total/$invoice_detail->qty : 0 ;
@endphp
@if(($invoice_detail->jenis_transaksi == 1))
@endif
{{ config('custom.jenis_transaksi')[$invoice_detail->shopTransaction->jenis_transaksi] }} | {{ @$invoice_detail->shopTransaction->user->nama }}
{{ date('d-m-Y',strtotime($invoice_detail->date)) }}
{{@$invoice_detail->room_no}}
{{$invoice_detail->qty}}
{{-- {{ribuan($harga_satuan)}} --}}
{{ribuanWithComma($harga_satuan)}}
{{-- {{ ribuan($invoice_detail->total) }} --}}
{{ ribuanWithComma($invoice_detail->total) }}
@if ($invoice_detail->jenis_transaksi == 1)
@php $balance_due += $invoice_detail->total; @endphp
@endif
@if($invoice_kamar->status_booking != 2)
@if(\Session::get('backdate'))
@if(\Session::get('backdate') == $invoice_detail->date)
{{--
--}}
@else
@if (\Auth::user()->isAdmin())
@endif
@endif
@else
@endif
@else
@endif
{{-- BOOKING DEPOSIT --}}
@elseif($invoice_detail->booking_deposit_id)
@php
$description_invoice_deposit = '';
if (@$invoice_detail->bookingDeposit->jenis_deposit != 5) {
$description_invoice_deposit = $invoice_detail->description .' '.( $invoice_detail->bookingDeposit->jenis_deposit != 1 ? config('custom.jenis_deposit')[@$invoice_detail->bookingDeposit->jenis_deposit].' '.@$invoice_detail->bookingDeposit->bank : '' ).' '.(@$invoice_detail->bookingDeposit->platform->nama ?? '').' '.(@$invoice_detail->bookingDeposit->voucher ? '/'.@$invoice_detail->bookingDeposit->voucher : '').' '.(@$invoice_detail->bookingDeposit->description ? '- '.@$invoice_detail->bookingDeposit->description : '' );
}else{
$description_invoice_deposit = $invoice_detail->description .' '. config('custom.jenis_deposit')[@$invoice_detail->bookingDeposit->jenis_deposit].' - '.(@$invoice_detail->bookingDeposit->transfer ? 'Transfer' : (@$invoice_detail->bookingDeposit->segmentation ? config('custom.segment_ratecodes')[@$invoice_detail->bookingDeposit->segmentation] : '')).' '.(@$invoice_detail->bookingDeposit->platform->nama ?? '').' '.(@$invoice_detail->bookingDeposit->voucher ? '/'.@$invoice_detail->bookingDeposit->voucher : '').' '.(@$invoice_detail->bookingDeposit->description ? '- '.@$invoice_detail->bookingDeposit->description : '' );
}
@endphp
@if(($invoice_detail->jenis_transaksi == 1))
{{-- --}}
@endif
{{ config('custom.jenis_transaksi')[$invoice_detail->bookingDeposit->jenis_transaksi] }} | {{@$invoice_detail->bookingDeposit->user->nama}}
{{ date('d-m-Y', strtotime($invoice_detail->date)) ?? '-' }}
{{@$invoice_detail->room_no}}
{{-- {{@$invoice_detail->bookingDeposit->user->nama}} --}}
{{-- {{ $invoice_detail->description }} {{ config('custom.jenis_deposit')[@$invoice_detail->bookingDeposit->jenis_deposit].' '.@$invoice_detail->bookingDeposit->bank }} {{@$invoice_detail->bookingDeposit->platform->nama ?? ''}} {{ @$invoice_detail->bookingDeposit->voucher ? '/'.@$invoice_detail->bookingDeposit->voucher : '' }} {{ @$invoice_detail->bookingDeposit->description ? '- '.@$invoice_detail->bookingDeposit->description : '' }} --}}
{{ $description_invoice_deposit }}
{{-- {{ribuan($invoice_detail->total *-1 )}} --}}
{{ribuanWithComma($invoice_detail->total *-1 )}}
@if ($invoice_detail->jenis_transaksi == 1)
@php $balance_due -= $invoice_detail->total; @endphp
@endif
@if($invoice_kamar->status_booking != 2)
@if(\Session::get('backdate'))
@if(\Session::get('backdate') == $invoice_detail->date)
{{-- @if(\Session::get('shift')) --}}
{{-- --}}
{{-- @endif --}}
@else
@if (\Auth::user()->isAdmin())
@endif
@endif
@else
@if (\Auth::user()->isAdmin())
@endif
@endif
@else
@endif
@endif
@php $idx_item++; @endphp
@endforeach
@endif
@endif
{{-- fetch pembayaran --}}
@if($pembayarans)
@foreach ($pembayarans as $key=>$pembayaran)
@php
$description_pembayaran = '';
if (!in_array($pembayaran->jenis_pembayaran_id, [5])){
$description_pembayaran .= 'Payment '.($pembayaran->jenis_pembayaran_id ? (config('custom.jenis_pembayaran')[$pembayaran->jenis_pembayaran_id].' '.$pembayaran->bank) : '').' '.(@$pembayaran->platformPembayaran->nama ?? '').' A.N. '.@$pembayaran->invoice->nama_pelanggan.' '.($pembayaran->voucher ? '/'.$pembayaran->voucher : '').' '.($pembayaran->description ? '- '.$pembayaran->description : '');
}else{
$description_pembayaran .= 'Payment '.($pembayaran->jenis_pembayaran_id ? (config('custom.jenis_pembayaran')[$pembayaran->jenis_pembayaran_id].' '.$pembayaran->bank) : '').' - '.($pembayaran->transfer ? 'Transfer' : ($pembayaran->segment ? config('custom.segment_ratecodes')[$pembayaran->segment] : '')).' A.N. '.@$pembayaran->invoice->nama_pelanggan.' '.($pembayaran->voucher ? '/'.$pembayaran->voucher : '').' '.($pembayaran->description ? '- '.$pembayaran->description : '');
}
@endphp
@if ($pembayaran->tipe_pembayaran == 1)
Posting | {{@$pembayaran->user->nama}}
{{date('d-m-Y', strtotime($pembayaran->transaction_date))}}
{{@$invoice_titles->nomor_kamar}}
{{-- Pembayaran {{ $pembayaran->jenis_pembayaran_id ? config('custom.jenis_pembayaran')[$pembayaran->jenis_pembayaran_id].' '.$pembayaran->bank : '' }} {{@$pembayaran->platformPembayaran->nama ?? ''}} A.N. {{ $pembayaran->invoice->nama_pelanggan }} {{ $pembayaran->voucher ? '/'.$pembayaran->voucher : '' }} {{ $pembayaran->description ? '- '.$pembayaran->description : '' }} --}}
{{ $description_pembayaran }}
{{-- {{ribuan($pembayaran->nominal *-1 )}} --}}
{{ribuanWithComma($pembayaran->nominal *-1 )}}
@php $balance_due -= $pembayaran->nominal; @endphp
@if (\Auth::user()->isAdmin() && $pembayaran->tipe_pembayaran == 1 && ($invoice_kamar->status_booking != 2) )
@endif
@else
@php
$refunds[] = $pembayaran;
@endphp
@endif
@php $idx_item++; @endphp
@endforeach
@endif
{{-- Fetch booking deposit --}}
@if($booking_deposits)
@foreach($booking_deposits as $key => $deposit)
@php
$description_deposit = '';
if (!in_array($deposit->jenis_deposit, [5])){
$description_deposit .= ($deposit->deposit_reservasi == 1 ? "Deposit" : "Payment").' '.config('custom.jenis_deposit')[$deposit->jenis_deposit].' '.$deposit->bank.' '.(@$deposit->platform->nama ?? '').' A.N. '.$deposit->nama.' '.($deposit->voucher ? '/'.$deposit->voucher : '').' '.($deposit->description ? '- '.$deposit->description : '');
}else{
$description_deposit .= ($deposit->deposit_reservasi == 1 ? "Deposit" : "Payment").' '.(config('custom.jenis_deposit')[$deposit->jenis_deposit].' '.$deposit->bank).' - '.($deposit->transfer ? 'Transfer' : ($deposit->segmentation ? config('custom.segment_ratecodes')[$deposit->segmentation] : '')).' A.N. '. $deposit->nama.' '.($deposit->voucher ? '/'.$deposit->voucher : '').' '.($deposit->description ? '- '.$deposit->description : '');
}
@endphp
@if(($deposit->jenis_transaksi == 1) && is_null($deposit->deleted_at) ? 'checked' : '')
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? 'checked' : ''}}
>
@endif
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}
>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
jenis_deposit].' '.$deposit->bank }} {{@$deposit->platform->nama ?? ''}} A.N. {{ $deposit->nama }} {{ $deposit->voucher ? '/'.$deposit->voucher : '' }} {{ $deposit->description ? '- '.$deposit->description : '' }}" --}}
value="{{ $description_deposit }}"
{{($deposit->jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}
>
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}>
{{ config('custom.jenis_transaksi')[$deposit->jenis_transaksi] }} | {{ @$deposit->user->nama }}
{{ date('d-m-Y', strtotime($deposit->transaction_date)) }}
{{@$deposit->nomor_kamar}}
{{-- @if (!in_array($deposit->jenis_deposit, [5]))
{{$deposit->deposit_reservasi == 1 ? "Deposit" : "Pembayaran" }} {{ config('custom.jenis_deposit')[$deposit->jenis_deposit].' '.$deposit->bank }} {{@$deposit->platform->nama ?? ''}} A.N. {{ $deposit->nama }} {{ $deposit->voucher ? '/'.$deposit->voucher : '' }} {{ $deposit->description ? '- '.$deposit->description : '' }}
@else
{{ config('custom.jenis_deposit')[$deposit->jenis_deposit].' '.$deposit->bank }} - {{ $deposit->transfer ? 'Transfer' : config('custom.segment_ratecodes')[$deposit->segmentation] }} A.N. {{ $deposit->nama }} {{ $deposit->voucher ? '/'.$deposit->voucher : '' }} {{ $deposit->description ? '- '.$deposit->description : '' }}
@endif --}}
{{$description_deposit}}
jenis_transaksi == 1) && is_null($deposit->deleted_at) ? '' : 'disabled'}}
>
@if($deposit->jenis_transaksi == 1)
{{-- {{ ribuan($deposit->nominal *-1 ) }} --}}
{{ ribuanWithComma($deposit->nominal *-1 ) }}
@php $balance_due -= $deposit->nominal ; @endphp
@else
{{-- {{ ribuan($deposit->nominal *-1 ) }} --}}
{{ ribuanWithComma($deposit->nominal *-1 ) }}
@php $balance_due += $deposit->nominal ; @endphp
@endif
{{-- @if(\Session::get('shift')) --}}
@if($invoice_kamar->status_booking != 2)
@if(dateFormat($deposit->transaction_date, 'Y-m-d') == getSystemDate() && is_null($deposit->deposit_reservasi))
@if($deposit->jenis_transaksi == 1 && is_null($deposit->deleted_at))
@elseif ($deposit->jenis_transaksi == 0)
@endif
@else
@if (\Auth::user()->isAdmin() && $deposit->jenis_transaksi == 1)
@endif
@endif
@else
@endif
{{-- @endif --}}
@php $idx_item++; @endphp
@endforeach
@endif
{{-- Fetch Transaksi Shop --}}
@if($tambahan)
@foreach ($tambahan as $key=>$value)
@foreach ($value as $key2 => $val)
@php
$harga_satuan = $val->jumlah > 0 ? $val->grand_total / $val->jumlah : 0;
@endphp
@if(($val->jenis_transaksi == 1) && is_null($val->deleted_at) ? 'checked' : '')
jenis_transaksi == 1) && is_null($val->deleted_at) ? 'checked' : ''}}
>
@endif
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}
>
{{ config('custom.jenis_transaksi')[$val->jenis_transaksi] }} | {{ @$val->user->nama }}
{{ date('d-m-Y',strtotime($val->transaction_date)) }}
{{@$val->kamar->no_kamar}}
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}>
{{ ribuan($val->jumlah) }}
{{-- {{ ribuan($harga_satuan) }} --}}
{{ ribuanWithComma($harga_satuan) }}
jenis_transaksi == 1) && is_null($val->deleted_at) ? '' : 'disabled'}}
>
@if($val->jenis_transaksi == 1)
{{-- {{ ribuan($val->grand_total) }} --}}
{{ ribuanWithComma($val->grand_total) }}
@php $balance_due += $val->grand_total; @endphp
@else
{{-- {{ ribuan($val->grand_total) }} --}}
{{ ribuanWithComma($val->grand_total) }}
@php $balance_due -= $val->grand_total; @endphp
@endif
{{-- @if(\Session::get('shift')) --}}
@if($invoice_kamar->status_booking != 2)
@if($val->transaction_date == getSystemDate())
@if($val->jenis_transaksi == 1 && is_null($val->deleted_at))
@elseif ($val->jenis_transaksi == 0)
@endif
@else
@if (\Auth::user()->isAdmin() && $val->jenis_transaksi == 1)
@endif
@endif
@else
@endif
{{-- @else --}}
{{-- --}}
{{-- @endif --}}
@php $idx_item++; @endphp
@endforeach
@endforeach
@endif
{{-- Fetch Transaksi POS hanya total bill --}}
@if($pembayaran_pos)
@foreach ($pembayaran_pos as $key=>$value)
@php
$harga_satuan = $value->nominal;
@endphp
@if(($value->jenis_transaksi == 1) && is_null($value->deleted_at) ? 'checked' : '')
jenis_transaksi == 1) && is_null($value->deleted_at) ? 'checked' : ''}}
>
@endif
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}
>
{{ config('custom.jenis_transaksi')[$value->jenis_transaksi] }} | {{ @$value->cart->user->nama }}
{{ date('d-m-Y',strtotime($value->transaction_date)) }}
{{@$value->nomor_kamar}}
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}>
{{-- {{ ribuan($harga_satuan) }} --}}
{{ ribuanWithComma($harga_satuan) }}
jenis_transaksi == 1) && is_null($value->deleted_at) ? '' : 'disabled'}}
>
@if($value->jenis_transaksi == 1)
{{-- {{ ribuan($value->nominal) }} --}}
{{ ribuanWithComma($value->nominal) }}
@php $balance_due += $value->nominal; @endphp
@else
{{-- {{ ribuan($value->nominal *-1 ) }} --}}
{{ ribuanWithComma($value->nominal *-1 ) }}
@php $balance_due -= $value->nominal *-1 ; @endphp
@endif
{{-- @if(\Session::get('shift')) --}}
{{-- @if($invoice_kamar->status_booking != 2)
@if($value->transaction_date == getSystemDate())
@if($value->jenis_transaksi == 1 && is_null($value->deleted_at))
@endif
@else --}}
@if (\Auth::user()->isAdmin() && $value->jenis_transaksi == 1)
@endif
{{-- @endif
@endif --}}
{{-- @endif --}}
@php $idx_item++; @endphp
@endforeach
@endif
{{-- Fetch refund --}}
@if ($refunds)
@foreach ($refunds as $key=>$pembayaran)
@if ($pembayaran->tipe_pembayaran == 2)
Posting | {{ @$pembayaran->user->nama }}
{{date('d-m-Y', strtotime($pembayaran->transaction_date))}}
{{@$invoice_titles->nomor_kamar}}
Refund {{ config('custom.jenis_pembayaran')[$pembayaran->jenis_pembayaran_id].' '.$pembayaran->bank }} A.N. {{ $pembayaran->booking->nama }}
{{-- {{ribuan($pembayaran->nominal)}} --}}
{{ribuanWithComma($pembayaran->nominal)}}
@php $balance_due += $pembayaran->nominal; @endphp
@else
@php
$refunds[] = $pembayaran;
@endphp
@endif
@php $idx_item++; @endphp
@endforeach
@endif
@else
Belum Ada Transaksi
@endif
Balance Due | {{ribuanWithComma($balance_due)}}