66 lines
3.0 KiB
PHP
66 lines
3.0 KiB
PHP
|
|
<table class="table" id="datatable">
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th class="d-print-none">{{ __('SL') }}.</th>
|
||
|
|
@if (auth()->user()->accessToMultiBranch())
|
||
|
|
<th class="text-start">{{ __('Branch') }}</th>
|
||
|
|
@endif
|
||
|
|
<th class="text-start">{{ __('Category') }}</th>
|
||
|
|
<th class="text-start">{{ __('Expense For') }}</th>
|
||
|
|
<th class="text-start d-print-none">{{ __('Payment Type') }}</th>
|
||
|
|
<th class="text-start">{{ __('Reference Number') }}</th>
|
||
|
|
<th class="text-start">{{ __('Expense Date') }}</th>
|
||
|
|
<th class="text-end">{{ __('Amount') }}</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
@foreach ($expense_reports as $expense_report)
|
||
|
|
<tr>
|
||
|
|
<td class="d-print-none">{{ $loop->iteration }}
|
||
|
|
</td>
|
||
|
|
@if (auth()->user()->accessToMultiBranch())
|
||
|
|
<td class="text-start">{{ $expense_report->branch->name ?? '' }}</td>
|
||
|
|
@endif
|
||
|
|
<td class="text-start">{{ $expense_report->category->categoryName }}</td>
|
||
|
|
<td class="text-start">{{ $expense_report->expanseFor }}</td>
|
||
|
|
<td class="text-start">
|
||
|
|
@if ($expense_report->transactions && $expense_report->transactions->isNotEmpty())
|
||
|
|
{{ $expense_report->transactions->map(function($transaction) {
|
||
|
|
if ($transaction->transaction_type === 'bank_payment' && !empty($transaction->paymentType?->name)) {
|
||
|
|
return $transaction->paymentType->name;
|
||
|
|
}
|
||
|
|
return $transaction->transaction_type
|
||
|
|
? ucfirst(explode('_', $transaction->transaction_type)[0])
|
||
|
|
: '';
|
||
|
|
})->unique()->implode(', ') }}
|
||
|
|
@elseif ($expense_report->payment_type_id)
|
||
|
|
{{ $expense_report->payment_type?->name }}
|
||
|
|
@else
|
||
|
|
{{ $expense_report->paymentType }}
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td class="text-start">{{ $expense_report->referenceNo }}</td>
|
||
|
|
<td class="text-start">{{ formatted_date($expense_report->expenseDate) }}</td>
|
||
|
|
<td class="text-end">
|
||
|
|
{{ currency_format($expense_report->amount, currency: business_currency()) }}</td>
|
||
|
|
</tr>
|
||
|
|
@endforeach
|
||
|
|
</tbody>
|
||
|
|
@if ($expense_reports->count() > 0)
|
||
|
|
<tr class="table-footer">
|
||
|
|
<td class="d-print-none text-start">{{ __('Total') }}</td>
|
||
|
|
@if (auth()->user()->accessToMultiBranch())
|
||
|
|
<td></td>
|
||
|
|
@endif
|
||
|
|
<td></td>
|
||
|
|
<td></td>
|
||
|
|
<td></td>
|
||
|
|
<td></td>
|
||
|
|
<td></td>
|
||
|
|
<td class="text-end">
|
||
|
|
{{ currency_format($expense_reports->sum('amount'), currency: business_currency()) }}
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
@endif
|
||
|
|
</table>
|