@php $documents = []; @endphp Expense

Aarya Agriculture

{{ $contact_us->address ?? '' }}
TAN No: 240524145214 GST No: 24AFRFNA4448ICZQ

Mobile No.: {{ $contact_us->mobile ?? '' }} Email: {{ $contact_us->email ?? '-' }}

Expense Request

@if ($expense->expenseHistories->count() > 0 && $expense->expenseHistories->where('status', 2)->count() > 0) @foreach ($expense->expenseHistories->where('status', 2) as $history) @endforeach @endif
Requested Employee {{ $expense->employee->employee_name ?? '' }}
Employee Code {{ $expense->employee->employee_code ?? '' }}
Employee Department {{ $expense->employee->employeeDepartment->name ?? '' }}
Expense Period {{ date('d-m-Y', strtotime($expense->from)) }} To {{ date('d-m-Y', strtotime($expense->to)) }}
Requested Date {{ $expense->created_at ? date('d-m-Y', strtotime($expense->created_at)) : '' }}
Requested Amount (₹) {{ number_format($expense->total_amount, 2) }}
Status @if ($expense->status == '0') Requested @elseif ($expense->status == '1') Approved @elseif ($expense->status == '2') Paid @elseif($expense->status == '3') Rejected @else - @endif
Paid Amount (₹) {{ number_format($expense->paid_amount, 2) }}
Paid Date {{ date('d-m-Y', strtotime($history->updated_at)) }}
Voucher No. {{ $expense->voucher_no ?? '' }}

Expense Items

@if (isset($expense->expenseItems) && count($expense->expenseItems) > 0) @foreach ($expense->expenseItems as $expenseItem) @php $documents[] = $expenseItem->document ?? ''; @endphp @endforeach @else @endif
# Type Sub Type Amount Payment Mode Date Remark
{{ $loop->iteration }} {{ $expenseItem->expenseType->name ?? '' }} {{ $expenseItem->expenseSubType->name ?? '' }} {{ $expenseItem->amount ?? 0 }} {{ $expenseItem->payment_mode ?? '' }} {{ date('d-m-Y', strtotime($expenseItem->date)) }} {{ $expenseItem->remark ?? '' }}
Items not found!

Process History

@if (isset($expense->expenseHistories) && count($expense->expenseHistories) > 0) @foreach ($expense->expenseHistories as $expenseHistory) @php $role = ''; $actionTakerName = ''; $dateTime = ''; if (isset($expenseHistory->created_by)) { $role = $expenseHistory->creator?->employeeMaster?->employeeDesignation?->name; $actionTakerName = $expenseHistory->creator->name; $dateTime = $expenseHistory->created_at->format('d-m-Y h:i:s A'); } if (isset($expenseHistory->updated_by)) { $role = $expenseHistory->editor?->employeeMaster?->employeeDesignation?->name; $actionTakerName = $expenseHistory->editor->name; $dateTime = $expenseHistory->updated_at->format('d-m-Y h:i:s A'); } @endphp @endforeach @else @endif
# User Name Status Remark Date
{{ $loop->iteration }} {{ $actionTakerName }}
{{ $role }}
@if ($expenseHistory->status == '0') Requested @elseif ($expenseHistory->status == '1') Approved @elseif ($expenseHistory->status == '2') Paid @elseif($expenseHistory->status == '3') Rejected @else - @endif {{ $expenseHistory->remark }} {{ $dateTime }}
Data not found!
@if (count($documents) > 0)
@foreach ($documents as $document) @if (!empty($document))

Attachment

Expense Document Image
@endif @endforeach
@endif