@include('set_tenant_db')

Expense Management

@php $id = request('id'); $expense_dtl = DB::select("SELECT * FROM expensehdr WHERE empl_cd ='" . Auth::user()->userid . "' 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 if the highlight class should be applied $highlightClass = ''; if ($expense->voucher_type == 'Advance') { $highlightClass = 'advance-highlight'; } // Check if status is not Draft $showPrint = ($expense->status != 'Draft'); @endphp @if (($expense->voucher_type == 'Advance' && $expense->status != 'Authorized' && $expense->status != 'Approved' && $expense->status != 'Rejected' && $expense->status != 'Sent_For_Approval' && $expense->status != 'Paid' && $expense->status != 'Hold')) @elseif (($expense->voucher_type == 'Expense' && $expense->status != 'Authorized' && $expense->status != 'Approved' && $expense->status != 'Rejected' && $expense->status != 'Sent_For_Approval' && $expense->status != 'Paid' && $expense->status != 'Hold')) @else @endif @if($expense->voucher_type == 'Advance') @else @endif @endforeach
Action Statement ID Statement Date Total Amount Purpose Status
@if($showPrint) @endif @if($showPrint) @endif @if($showPrint) @endif {{ $expense->stmt_id }} {{ date("d M Y", strtotime($expense->stmt_date)) }}{{ $tot_adv_amount }}{{ $totamount }}{{ $expense->remarks }} {{ $expense->status }}