@include('set_tenant_db')

Expense Approval / Authorize


@php $id = request('id'); //$expense_dtl = DB::select("SELECT * FROM expensehdr WHERE empl_cd ='" . Auth::user()->userid . "' and status = 'Sent_For_Approval' ORDER BY expensehdr.id DESC"); //$expense_dtl = DB::select("SELECT * FROM expensehdr WHERE status = 'Sent_For_Approval' and empl_cd in (select empl_cd from employee where rpt_to_emp = '".Auth::user()->userid."') ORDER BY expensehdr.id DESC"); $expense_dtl = DB::select("SELECT * FROM expensehdr WHERE ((expensehdr.status = 'Sent_For_Approval' and expensehdr.empl_cd in (select empl_cd from employee where rpt_to_emp = '".Auth::user()->userid."')) OR (expensehdr.status = 'Approved' and expensehdr.empl_cd in (select empl_cd from employee where rpt_to_emp1 = '".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; } @endphp @if ($expense->status == 'Sent_For_Approval' || $expense->status == 'Approved') @else @endif @if($expense->voucher_type == 'Advance') @else @endif @endforeach
Action Statement ID Statement Date Total Amount Purpose Status
{{ $expense->stmt_id }} {{ $expense->stmt_date }} {{ $tot_adv_amount }}{{ $totamount }}{{ $expense->remarks }} {{ $expense->status }}