FOODOSO

Jl M. H. Thamrin, No. 9

221-691-6080


Transaction Report

For {{ isset($_GET['month']) && isset($_GET['year']) ? 'transactions in '.strftime('%B', mktime(0, 0, 0, $_GET['month'], 1)).' '.$_GET["year"] : (isset($_GET['month']) ? 'transactions in '.strftime('%B', mktime(0, 0, 0, $_GET['month'], 1)) : (isset($_GET['year']) ? 'transactions in '.$_GET["year"] : (isset($_GET["data"]) && $_GET["data"] == 'all' ? 'all transactions' : (isset($_GET["data"]) && $_GET["data"] == 'today' ? 'transactions today' : (isset($_GET["data"]) && $_GET["data"] == 'thisMonth' ? 'transactions this month' : 'bau' ))))) }}

@can('manager') @endcan @php $profit = []; $profit_items = 0; @endphp @foreach ($data as $item) @php foreach ($item->transaction_details as $key ) { $profit_items += ($key->menu->price - $key->menu->modal) * $key->qty; } $profit[] = $profit_items; $total_profit = array_reduce($profit, "myfunction"); @endphp @can('manager') @endcan @can('cashier') @endcan @can('manager') @endcan @endforeach @php $arr_transaction = []; foreach($data as $item) { $arr_transaction[] = $item->total_transaction; }; function myfunction($v1,$v2) { return $v1 + $v2; } $total_transaction = array_reduce($arr_transaction, "myfunction"); @endphp @can('manager') @endcan @can('cashier') @endcan @can('manager') @endcan
Transaction date Product No Table TotalPayment Profit
{{ $item->created_at->format('d M Y') }} @foreach ($item->transaction_details as $el) {{ $el->menu->name.',' }} @endforeach @foreach ($item->transaction_details as $el) {{ $el->menu->name.',' }} @endforeach {{ $item->no_table }} Rp. {{ number_format($item->total_transaction, 0, ',', '.') }}Rp. {{ number_format($item->total_payment, 0, ',', '.') }} Rp. {{ number_format($profit_items, 0, ',', '.') }}
Total revenue Rp. {{ number_format($total_transaction, 0, ',', '.') }}Total Transaction's Rp. {{ number_format($total_transaction, 0, ',', '.') }}
Total profit Rp. {{ number_format($total_profit, 0, ',', '.') }}