@php
// dd($transactions[1]->pembayaranpos);
// variable nominal total
$total_cash = 0;
$total_card = 0;
$total_digital = 0;
$total_transfer_kamar = 0;
$total_nonstay = 0;
$total_ledger = 0;
$total_change = 0;
// variable total_tagihan
$total_gross = 0;
// variable total compliment
$total_compliment = 0;
// variable nett
$total_nett = 0;
// variable total
$Total = 0;
@endphp
@if(count($transactions) > 0)
@foreach ( $transactions as $index=>$item )
@php
// variable nominal column
$nominal_cash = 0;
$nominal_card = 0;
$nominal_digital = 0;
$nominal_kamar = 0;
$nominal_nonstay = 0;
$nominal_ledger = 0;
// menghitung total harga dengan cost complimentary
$grand_total_complimentary = 0;
if ($item->complimentary_id > 0) {
foreach ($item->menu as $k => $menu) {
$grand_total_complimentary += $menu->grand_total_complimentary;
}
}
// sum total tagihan
if ($item->complimentary_id == 0) {
$total_gross += $item->grand_total_pos;
}
// sum total tagihan by compliement
if ($item->complimentary_id != 0) {
$total_compliment += $grand_total_complimentary;
}
// Ambil dan Sum Transfer Kamar
if ($item->status == 3) {
$nominal_kamar += $item->grand_total_pos;
}
// elseif ($item->status == 4) {
// $nominal_nonstay += $item->grand_total_pos;
// }
// Ambil dan Sum ledger temporary :)
// if ($item->ledger_id != null) {
// $nominal_ledger += $item->grand_total_pos;
// }
@endphp
{{$item->order_flag}} |
{{$item->user->nama}} |
{{$item->nama_pelanggan}} |
{{ $item->complimentary_id > 0 ? ribuanWithComma( $grand_total_complimentary) : ribuanWithComma($item->grand_total_pos) }} |
@foreach ($item->pembayaranpos as $urutan=>$bayar)
@php
// Ambil dan Sum pembayaranpos ^_^
if ($bayar->jenis_pembayaran_id == 1) { //cash
$nominal_cash += $bayar->nominal;
}elseif ($bayar->jenis_pembayaran_id == 2) { //card
$nominal_card += $bayar->nominal;
}elseif ($bayar->jenis_pembayaran_id == 4) { //digital
$nominal_digital += $bayar->nominal;
}elseif ($bayar->jenis_pembayaran_id == 5) { //ledger
$nominal_ledger += $bayar->nominal;
}elseif ($bayar->jenis_pembayaran_id == 6) { //nonstay
$nominal_nonstay += $bayar->nominal;
}elseif ($bayar->jenis_pembayaran_id == 7) { //Room
$nominal_kamar += $bayar->nominal;
}
@endphp
@endforeach
{{ribuanWithComma($nominal_cash)}}
|
{{ribuanWithComma($nominal_card)}}
|
{{ribuanWithComma($nominal_digital)}}
|
{{ribuanWithComma($nominal_kamar)}}
|
{{ribuanWithComma($nominal_nonstay)}}
|
{{ribuanWithComma($nominal_ledger)}}
|
{{(@$nominal_cash - $item->grand_total_pos) > 0 ? ribuanWithComma(@$nominal_cash - $item->grand_total_pos) : 0}}
|
{{$item->complimentary_id ? 'compliment' : ''}}
|
@php
// sum total
$total_cash += $nominal_cash;
$total_card += $nominal_card;
$total_digital += $nominal_digital;
$total_transfer_kamar += $nominal_kamar;
$total_nonstay += $nominal_nonstay;
$total_ledger += $nominal_ledger;
$total_change += (@$nominal_cash - $item->grand_total_pos) > 0 ? (@$nominal_cash - $item->grand_total_pos) : 0;
@endphp
@endforeach
@php
// sum dan substract total
$total_gross += $total_compliment;
$total_nett = $total_gross - $total_compliment;
// Hitung Total untuk Summary
$Total = $total_cash + $total_card + $total_digital + $total_transfer_kamar + $total_nonstay + $total_ledger + $total_compliment;
@endphp
|
|
|
|
|
|
|
|
|
|
|
|
G - Total |
|
|
{{ribuanWithComma($total_gross)}} |
{{ribuanWithComma($total_cash)}} |
{{ribuanWithComma($total_card)}} |
{{ribuanWithComma($total_digital)}} |
{{ribuanWithComma($total_transfer_kamar)}} |
{{ribuanWithComma($total_nonstay)}} |
{{ribuanWithComma($total_ledger)}} |
{{ribuanWithComma($total_change)}} |
|
R - Total |
|
|
{{ribuanWithComma($total_nett)}} |
{{ribuanWithComma($total_cash)}} |
{{ribuanWithComma($total_card)}} |
{{ribuanWithComma($total_digital)}} |
{{ribuanWithComma($total_transfer_kamar)}} |
{{ribuanWithComma($total_nonstay)}} |
{{ribuanWithComma($total_ledger)}} |
{{ribuanWithComma($total_change)}} |
|
@else
Tidak Ada Transaksi Hari Ini
|
@endif