@include('set_tenant_db')

Cashier


@php $id = request('id'); // Updated query to match cashier.php filter: status = 'Authorized' OR status = 'Paid' OR status = 'Hold' $expense_dtl = DB::select("SELECT * FROM expensehdr WHERE status IN ('Authorized', 'Paid', 'Hold') ORDER BY expensehdr.id DESC"); @endphp @foreach($expense_dtl as $expense) @php $total_qry = DB::select("SELECT SUM(amount) as amt FROM expensedtl WHERE hdrid = '" . $expense->id . "'"); if(isset($total_qry[0]->amt)){ $totamount = $total_qry[0]->amt; }else{ $totamount = 0.00; } $total_adv_qry = DB::select("SELECT SUM(adv_amount) as amt FROM expensehdr WHERE id = '" . $expense->id . "'"); if(isset($total_adv_qry[0]->amt)){ $tot_adv_amount = $total_adv_qry[0]->amt; }else{ $tot_adv_amount = 0.00; } // Determine row class based on status - matching expdtl_cashier.blade.php $rowClass = 'status-row'; if ($expense->status == 'Authorized') { $rowClass = 'status-authorized'; } elseif ($expense->status == 'Hold') { $rowClass = 'status-hold'; } elseif ($expense->status == 'Paid') { $rowClass = 'status-paid'; } @endphp @if ($expense->status == 'Authorized') @elseif ($expense->status == 'Hold') @elseif ($expense->status == 'Paid') @else @endif @if($expense->voucher_type == 'Advance') @else @endif @endforeach
Action Statement ID Statement Date Total Amount Purpose Status
{{ $expense->stmt_id }} {{ date("d M Y", strtotime($expense->stmt_date)) }}{{ number_format($expense->adv_amount, 2) }}{{ number_format($totamount, 2) }}{{ $expense->remarks }} {{ $expense->status }}