@php $col = 0; @endphp @if(count($transactions) > 0) @php $colh = 0; $colspan_cat = 0; @endphp @if (count($tipe_menus) > 0) @foreach ($tipe_menus as $tipe) @if ($filtered_tipe === 0) @if ($TotalTransactionTipe[$tipe->id] > 0) @php $colspan_cat += 3; @endphp @endif @else @php $colspan_cat += 3; @endphp @endif @endforeach @endif @php // variable nominal total $total_cash = 0; $total_card = 0; $total_digital = 0; $total_transfer_kamar = 0; $total_nonstay = 0; $total_ledger = 0; $total_services = 0; $total_tax = 0; // variable total_tagihan $total_gross = 0; $total_change = 0; // variable total compliment $total_compliment = 0; $count_compliment = 0; // variable nett $total_nett = 0; // variable total $Total = 0; $Total_Disc_G = 0; $Total_Disc_N = 0; // variable total tipe gross/nett foreach ($tipe_menus as $tipe) { $total_tipe_gross[$tipe->id] = 0; $total_tipe_nett[$tipe->id] = 0; $disc_per_tipe[$tipe->id] = 0; } $total_tipe_gross[''] = 0; $total_tipe_nett[''] = 0; @endphp @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; $total_discount_bill= 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 ledger temporary :) if ($item->ledger_total != null) { $nominal_ledger += $item->ledger_total; } // Ambil hitungan yang compliment if ($item->complimentary_id != 0) { $count_compliment += 1; } $nominal_custom_menu = 0; @endphp @php $hitung_i = 0; @endphp @if (count($tipe_menus) >0) @foreach ($tipe_menus as $tipe) @if ($filtered_tipe === 0) @if ($TotalTransactionTipe[$tipe->id] > 0) {{-- @foreach (config('custom.jenis_tipe_item') as $jenis_cindex=>$jenis_ctipe) --}} @php // Variable $total_per_tipe = 0; $discount_per_tipe = 0; @endphp @foreach ($item->menu as $menu) @if ($menu->tipeMenu) @if ($menu->tipeMenu->id == $tipe->id) @php if ($item->complimentary_id > 0) { // sum total per tipe menu $total_per_tipe += $menu->grand_total_complimentary; }else{ // sum total per tipe menu $total_per_tipe += $menu->total_biaya; } $discount_per_tipe += $menu->diskon; $total_per_tipe -= $menu->diskon; @endphp @elseif($menu->tipeMenu->id == null) {{-- @if ($jenis_cindex === 3 ) --}} @php if ($item->complimentary_id > 0) { // sum total per tipe menu $total_per_tipe += $menu->grand_total_complimentary; }else{ // sum total per tipe menu $total_per_tipe += $menu->total_biaya; } $discount_per_tipe += $menu->diskon; $total_per_tipe -= $menu->diskon; @endphp {{-- @endif --}} @endif @endif @endforeach @php $total_discount_bill +=($discount_per_tipe*-1); @endphp {{-- @endforeach --}} @endif @else {{-- @foreach (config('custom.jenis_tipe_item') as $jenis_cindex=>$jenis_ctipe) --}} @php // Variable $total_per_tipe = 0; $discount_per_tipe = 0; @endphp @foreach ($item->menu as $menu) @if ($menu->tipeMenu) @if ($menu->tipeMenu->id == $tipe->id) @php if ($item->complimentary_id > 0) { // sum total per tipe menu $total_per_tipe += $menu->grand_total_complimentary; }else{ // sum total per tipe menu $total_per_tipe += $menu->total_biaya; } $discount_per_tipe += $menu->diskon; $total_per_tipe -= $menu->diskon; @endphp @elseif($menu->tipeMenu->id == null) {{-- @if ($jenis_cindex === 3 ) --}} @php if ($item->complimentary_id > 0) { // sum total per tipe menu $total_per_tipe += $menu->grand_total_complimentary; }else{ // sum total per tipe menu $total_per_tipe += $menu->total_biaya; } $discount_per_tipe += $menu->diskon; $total_per_tipe -= $menu->diskon; @endphp {{-- @endif --}} @endif @endif @endforeach @php $total_discount_bill +=($discount_per_tipe*-1); @endphp {{-- @endforeach --}} @endif @endforeach @php $total_tipe_gross[''] += $nominal_custom_menu ?? 0; $total_tipe_nett[''] += $nominal_custom_menu ?? 0; $total_discount_bill += $diskon_cm; @endphp @endif {{-- --}} @foreach ($item->pembayaranpos as $urutan=>$bayar) @php // Ambil dan Sum pembayaranpos ^_^ if ($bayar->jenis_pembayaran_id == 1) { $nominal_cash += $bayar->nominal; }elseif ($bayar->jenis_pembayaran_id == 2) { $nominal_card += $bayar->nominal; }elseif ($bayar->jenis_pembayaran_id == 4) { $nominal_digital += $bayar->nominal; }elseif ($bayar->jenis_pembayaran_id == 7) { $nominal_kamar += $bayar->nominal; }elseif ($bayar->jenis_pembayaran_id == 6) { $nominal_nonstay += $bayar->nominal; } @endphp @endforeach @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; // sum ppn and tax $total_services += $item->services_charge; $total_tax += $item->ppn_charge; @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; foreach ($tipe_menus as $tipe) { // variable $sum_tipe_gross = 0; $sum_tipe_nett = 0; $sum_diskon = 0; foreach ($details as $key => $data) { if ($data->tipeMenu) { if (@$data->tipeMenu->id == $tipe->id) { $sum_tipe_gross += @$data->cartresto->complimentary_id > 0 ? $data->grand_total_complimentary : $data->total_biaya; // kondisi ambil yang compliment if (@$data->cartresto->complimentary_id != 0) { $sum_tipe_nett += $data->grand_total_complimentary; }else{ $sum_tipe_nett += 0; } $sum_diskon += $data->diskon; } elseif ($data->tipeMenu->id == null) { if ($TG_ctipe_item_idx == 3) { $sum_tipe_gross += @$data->cartresto->complimentary_id > 0 ? $data->grand_total_complimentary : $data->total_biaya; // kondisi ambil yang compliment if (@$data->cartresto->complimentary_id != 0) { $sum_tipe_nett += $data->grand_total_complimentary; }else{ $sum_tipe_nett += 0; } $sum_diskon += $data->diskon; } } } } // get nett $sum_tipe_nett = $sum_tipe_gross - $sum_tipe_nett; $total_tipe_gross[$tipe->id] += $sum_tipe_gross ; $total_tipe_nett[$tipe->id] += $sum_tipe_nett ; $disc_per_tipe[$tipe->id] += $sum_diskon; $total_tipe_gross[$tipe->id] -= $disc_per_tipe[$tipe->id] ; $total_tipe_nett[$tipe->id] -= $disc_per_tipe[$tipe->id] ; } @endphp {{-- @foreach ($tipe_menus as $tipe) @endforeach --}} {{-- @foreach ($shops as $shop) @foreach (config('custom.jenis_tipe_item') as $cjenis_tipe_item_idx => $cjenis_tipe_item) @endforeach @endforeach --}} @if (count($tipe_menus) > 0) @foreach ($tipe_menus as $tipe) @if ($filtered_tipe === 0) @if ($TotalTransactionTipe[$tipe->id] > 0 && $filtered_tipe === 0) @endif @else @endif @endforeach @endif {{-- @foreach ($shops as $shop) @foreach (config('custom.jenis_tipe_item') as $fg_tipe_item_idx => $fg_tipe_item) @endforeach @endforeach --}} {{-- @foreach ($tipe_menus as $tipe) @endforeach --}} {{-- @foreach ($shops as $shop) @foreach (config('custom.jenis_tipe_item') as $fg_tipe_item_idx => $fg_tipe_item) @endforeach @endforeach --}} @if (count($tipe_menus) > 0) @foreach ($tipe_menus as $tipe) @if ($filtered_tipe === 0) @if ($TotalTransactionTipe[$tipe->id] > 0) {{-- --}} @endif @else {{-- --}} @endif @endforeach {{-- --}} @endif {{-- --}} {{-- --}} {{-- @foreach ($tipe_menus as $tipe) @endforeach --}} {{-- @foreach ($shops as $shop) @foreach (config('custom.jenis_tipe_item') as $fn_tipe_item_idx => $fn_tipe_item) @endforeach @endforeach --}} @if (count($tipe_menus) > 0) @foreach ($tipe_menus as $tipe) @if ($filtered_tipe === 0) @if ($TotalTransactionTipe[$tipe->id] > 0) {{-- --}} @endif @else {{-- --}} @endif @endforeach {{-- --}} @endif {{-- --}} {{-- --}} @endif
Bill Number Pax Cashier POS{{@$tipe->nama_tipe}}{{@$tipe->nama_tipe}}Custom MenuDisc{{'.'}} Services Tax Total Cash Card Digital Transfer Room Transfer NonStay Ledger Change Note
{{$item->order_flag}} 1 {{$item->user->nama}} {{-- {{ribuan($total_per_tipe)}} --}} {{ribuanWithComma($total_per_tipe)}} @if($discount_per_tipe > 0)
Disc. {{ribuanWithComma($discount_per_tipe)}} @endif
{{-- {{ribuan($total_per_tipe)}} --}} {{ribuanWithComma($total_per_tipe)}} @if($discount_per_tipe > 0)
Disc. {{ribuanWithComma($discount_per_tipe)}} @endif
@php //custom_menu $diskon_cm = 0; $total_custom_menu = 0; foreach ($item->menu as $menu) { if ($menu->keterangan_custom) { $nominal_custom_menu += $menu->total_biaya - $menu->diskon; // $total_custom_menu += $menu->total_biaya; } $diskon_cm += $menu->diskon; } @endphp {{-- {{ribuan($nominal_custom_menu)}} --}} {{ribuanWithComma($nominal_custom_menu)}} @php $Total_Disc_G += $total_discount_bill; $Total_Disc_N += $total_discount_bill; @endphp {{-- {{ribuan($total_discount_bill)}} --}} {{ribuanWithComma($total_discount_bill)}} {{-- {{ribuan($item->services_charge)}} --}} {{ribuanWithComma($item->services_charge)}} {{-- {{ribuan($item->ppn_charge)}} --}} {{ribuanWithComma($item->ppn_charge)}} {{$item->complimentary_id > 0 ? ribuan($grand_total_complimentary) : ribuan($item->grand_total_pos)}}{{$item->complimentary_id > 0 ? ribuanWithComma($grand_total_complimentary) : ribuanWithComma($item->grand_total_pos)}} {{-- {{ribuan($nominal_cash)}} --}} {{ribuanWithComma($nominal_cash)}} {{-- {{ribuan($nominal_card)}} --}} {{ribuanWithComma($nominal_card)}} {{-- {{ribuan($nominal_digital)}} --}} {{ribuanWithComma($nominal_digital)}} {{-- {{ribuan($nominal_kamar)}} --}} {{ribuanWithComma($nominal_kamar)}} {{-- {{ribuan($nominal_nonstay)}} --}} {{ribuanWithComma($nominal_nonstay)}} {{-- {{ribuan($nominal_ledger)}} --}} {{ribuanWithComma($nominal_ledger)}} {{($nominal_cash - $item->grand_total_pos) > 0 ? ribuanWithComma($nominal_cash - $item->grand_total_pos) : 0}} {{$item->complimentary_id ? 'C' : ''}}
Discount {{ribuan( $disc_per_tipe[$shop->id][$fg_tipe_item_idx] )}}
G - Total {{count($transactions)}} {{ribuan( $total_tipe_gross[$tipe->id] )}}{{ribuan( $total_tipe_gross[$shop->id][$fg_tipe_item_idx] )}}{{ribuan($total_tipe_gross[$tipe->id])}}{{ribuanWithComma($total_tipe_gross[$tipe->id])}}{{ribuan($total_tipe_gross[$tipe->id])}}{{ribuanWithComma($total_tipe_gross[$tipe->id])}}{{ribuan($total_tipe_gross[''])}}{{ribuanWithComma($total_tipe_gross[''])}}{{ribuan($Total_Disc_G)}} {{ribuan($total_services)}} {{ribuan($total_tax)}}{{ribuanWithComma($Total_Disc_G)}} {{ribuanWithComma($total_services)}} {{ribuanWithComma($total_tax)}} {{ribuan($total_gross)}} {{ribuan($total_cash)}} {{ribuan($total_card)}} {{ribuan($total_digital)}} {{ribuan($total_transfer_kamar)}} {{ribuan($total_nonstay)}} {{ribuan($total_ledger)}}{{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 @php $countMinusCompliment = count($transactions) - $count_compliment; @endphp {{$countMinusCompliment}} {{ribuan( $total_tipe_nett[$tipe->id] )}}{{ribuan( $total_tipe_nett[$shop->id][$fn_tipe_item_idx] )}}{{ribuan($total_tipe_nett[$tipe->id])}}{{ribuanWithComma($total_tipe_nett[$tipe->id])}}{{ribuan($total_tipe_nett[$tipe->id])}}{{ribuanWithComma($total_tipe_nett[$tipe->id])}}{{ribuan($total_tipe_nett[''])}}{{ribuanWithComma($total_tipe_nett[''])}}{{ribuan($Total_Disc_N)}} {{ribuan($total_services)}} {{ribuan($total_tax)}}{{ribuanWithComma($Total_Disc_N)}} {{ribuanWithComma($total_services)}} {{ribuanWithComma($total_tax)}} {{ribuan($total_nett)}} {{ribuan($total_cash)}} {{ribuan($total_card)}} {{ribuan($total_digital)}} {{ribuan($total_transfer_kamar)}} {{ribuan($total_nonstay)}} {{ribuan($total_ledger)}}{{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)}}