@php
$headName = 'N/A';
if ($ledger_head_details instanceof \Illuminate\Support\Collection && $ledger_head_details->isNotEmpty()) {
// Collection of head objects - get first head name
$firstHead = $ledger_head_details->first();
$headName = $firstHead->head_name ?? 'N/A';
} elseif (is_object($ledger_head_details) && isset($ledger_head_details->income)) {
// Object with income/expense properties
$collection = $ledger_head_details->income->isNotEmpty()
? $ledger_head_details->income
: ($ledger_head_details->expense->isNotEmpty() ? $ledger_head_details->expense : collect());
if ($collection->isNotEmpty()) {
$firstItem = $collection->first();
$headName = $firstItem->head_name ?? 'N/A';
}
}
@endphp
{{ ucfirst($headName) }}
@if ($url_segment == 'expense')
Cash Payments
@else
Cash Receipts
@endif
| Date |
Income Head Group Name |
Narration |
Amount |
|
|
Total |
0.00 |
@if ($url_segment == 'income')
Bank Receipts
@else
Bank Payments
@endif
| Date |
Income Head Group Name |
Narration |
Amount |
|
|
Total |
0.00 |