@if(count($transactions) > 0 && count($transactions) > 0 )
@php
$grand_total_qty = 0;
$grand_total_amount = 0;
$grand_total_bayar = 0;
@endphp
@foreach ( $transactions as $index => $collection )
@php
// 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;
// }
// }
// variabel untuk hitung total qty
$total_qty = 0;
// variable untuk hitung total sales
$amount = 0;
// variable untuk hitung total sales
$total_payment = 0;
@endphp
@foreach ($collection as $key => $transaction)
@php
//hitung qty
$total_qty += $transaction->jumlah;
// hitung total sales
$pamount = $transaction->cartresto->complimentary_id > 0 ? $transaction->grand_total_complimentary :$transaction->grand_total;
$pamount -= $transaction->diskon;
$amount += $pamount;
@endphp
{{formatDate($transaction->transaction_date)}} |
{{@$transaction->cartresto->table->nomor_meja}} |
{{@$transaction->cartresto->order_flag}} |
{{@$transaction->shop->nama}} |
{{@$transaction->tipeMenu->nama_tipe ?? '-'}} |
{{@$transaction->menu->nama ?? @$transaction->keterangan_custom}} |
{{$transaction->jumlah}} |
{{-- {{$transaction->cartresto->complimentary_id > 0 ? ribuan($transaction->grand_total_complimentary) : ribuan($transaction->grand_total)}} | --}}
{{ribuanWithComma($pamount)}}
@if ($transaction->diskon>0)
Disc. {{ribuanWithComma($transaction->diskon)}}
@endif
|
{{$transaction->created_at->format('H:i')}} |
{{$transaction->cartresto->nama_pelanggan}} |
@endforeach
|
|
|
|
|
Total |
{{-- {{ribuan($total_qty)}} |
{{ribuan($amount)}} | --}}
{{($total_qty)}} |
{{($amount)}} |
|
|
@php
// Grand total qty
$grand_total_qty += $total_qty;
// grand total amount
$grand_total_amount += $amount;
@endphp
@endforeach
@foreach ( $pembayarans as $index => $collection )
@php
// variabel untuk hitung total qty
$total_qty = 0;
// variable untuk hitung total sales
$total_payment = 0;
// variable untuk sum total bayar
$amount = 0;
@endphp
@foreach ( $collection as $key => $pembayaran)
@php
// hitung total qty
$total_qty += 1;
@endphp
{{formatDate($pembayaran->cart->transaction_date)}} |
{{@$pembayaran->cart->table->nomor_meja}} |
{{@$pembayaran->cart->order_flag}} |
{{@$pembayaran->cart->shop->nama}} |
{{$pembayaran->jenis_pembayaran_id ? config('custom.jenis_pembayaran')[$pembayaran->jenis_pembayaran_id] : ''}} |
{{$pembayaran->platform ? $pembayaran->platform->nama : (config('custom.jenis_pembayaran')[$pembayaran->jenis_pembayaran_id] ?? 'Compliment') }} |
1 |
{{-- -{{ribuan(@$pembayaran->nominal)}} | --}}
-{{(@$pembayaran->nominal)}} |
{{@$pembayaran->created_at->format('H:i')}} |
{{@$pembayaran->cart->nama_pelanggan}} |
@if ($pembayaran->jenis_pembayaran_id == 1)
@php
// hitung total bayar agar bisa dapat change
$change = $pembayaran->nominal - $pembayaran->cart->grand_total_pos;
@endphp
@if ($change > 0)
@php
// hitung total qty
$total_qty += 1;
// amount sudah terkurang dari change
$amount += $pembayaran->nominal - $change;
@endphp
{{formatDate($pembayaran->transaction_date)}} |
{{@$pembayaran->cart->table->nomor_meja}} |
{{@$pembayaran->cart->order_flag}} |
{{@$pembayaran->cart->shop->nama}} |
{{ $pembayaran->jenis_pembayaran_id ? config('custom.jenis_pembayaran')[$pembayaran->jenis_pembayaran_id] : '' }} (Change) |
{{$pembayaran->platform ? $pembayaran->platform->nama : (config('custom.jenis_pembayaran')[$pembayaran->jenis_pembayaran_id] ?? 'Compliment') }} |
1 |
{{-- {{ribuan(@$change)}} | --}}
{{(@$change)}} |
{{@$pembayaran->created_at->format('H:i')}} |
{{@$pembayaran->cart->nama_pelanggan}} |
@else
@php
// amount sudah terkurang dari change
$amount += $pembayaran->nominal - 0;
@endphp
@endif
@else
@php
// amount untuk non cash
$amount += $pembayaran->nominal ;
@endphp
@endif
@endforeach
@php
// total dari qry per article
$grand_total_qty += $total_qty;
// Total Dari amount per article
$grand_total_bayar += $amount;
@endphp
|
|
|
|
|
Total |
{{-- {{ribuan($total_qty)}} |
{{ribuan($amount)}} | --}}
{{($total_qty)}} |
{{($amount*-1)}} |
|
|
@endforeach
@php
// Balance Total
$grand_total_amount = $grand_total_amount - $grand_total_bayar ;
@endphp
|
|
|
|
|
Grand Total |
{{$grand_total_qty}} |
{{-- {{ribuan($grand_total_amount)}} | --}}
{{($grand_total_amount)}} |
|
|
@else
Tidak Ada Transaksi Hari Ini
|
@endif