@extends('master') @section('content') @php $startYearMonth = $loans['fiscalYearStartMonth']; $endYearMonth = $loans['fiscalYearEndMonth']; $start = new DateTime($startYearMonth . '-01'); $end = new DateTime($endYearMonth . '-01'); $end->modify('+1 month'); // Include the end month in the loop @endphp

{{ __('Yearly Loan Ledger') }}

{{ __('Fiscal Year: ') . '' . $start->format('Y') . '-' . $end->format('Y') }}

Employee ID: {{ $employeeInfo->employee_no }}
Name: {{ $employeeInfo->employee_name }}
Department: {{ $employeeInfo->department->department_name }}
Designation: {{ $employeeInfo->designation->designation_name }}
@while ($start < $end) @php $yearMonth = $start->format('Y-m'); @endphp @php $start->modify('+1 month'); @endphp @endwhile
Month Year Loan Amount Paid Amount Remaining Amount
{{ $start->format('F') }} {{ isset($loans[$yearMonth . '_debit_amount']) ? $loans[$yearMonth . '_debit_amount'] : '' }} {{ isset($loans[$yearMonth . '_credit_amount']) ? $loans[$yearMonth . '_credit_amount'] : '' }} {{ isset($loans[$yearMonth . '_remaining_amount']) ? $loans[$yearMonth . '_remaining_amount'] : '' }}
Total {{ isset($loans['debit_total']) ? $loans['debit_total'] : '' }} {{ isset($loans['credit_total']) ? $loans['credit_total'] : '' }} {{ isset($loans['remaining_total']) ? $loans['remaining_total'] : '' }}
@endsection @section('page_script') @endsection