<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Loan Advance Summary Report</title>

    <style>
        @page {
            margin: 140px 20px 80px 20px;
        }

        body {
            font-family: DejaVu Sans, sans-serif;
            font-size: 12px;
            margin: 0;
        }

        /* =========================
           HEADER
        ========================== */
        .header {
            position: fixed;
            top: -120px;
            left: 0;
            right: 0;
            height: 100px;
        }

        .header-left {
            float: left;
            width: 70%;
        }

        .header-right {
            float: right;
            width: 30%;
            text-align: right;
        }

        .report-name {
            font-size: 15px;
            font-weight: bold;
        }

        .company-name {
            font-size: 13px;
            font-weight: bold;
        }

        .small-text {
            font-size: 11px;
        }

       .footer {
            position: fixed;
            bottom: -60px;
            left: 0;
            right: 0;
            height: 50px;
            font-size: 10px;
        }

        .footer-left {
            float: left;
            width: 33%;
            text-align: left;
        }

        .footer-center {
            float: left;
            width: 34%;
            text-align: center;
        }

        .footer-right {
            float: right;
            width: 33%;
            text-align: right;
        }

        .page-number:before {
            content: "Page " counter(page) " / " counter(pages);
        }

        /* =========================
           TABLE
        ========================== */
        table {
            width: 100%;
            border-collapse: collapse;
        }

        th, td {
            border: 1px solid #000;
            padding: 4px;
            font-size: 8px;
        }

        th {
            background: #f2f2f2;
            font-weight: bold;
        }

        td.number {
            text-align: right;
        }

        .clearfix::after {
            content: "";
            display: table;
            clear: both;
        }
    </style>
</head>
<body>

<!-- ================= HEADER ================= -->
<div class="header">
    <div class="header-left">
        <div class="report-name">
            Loan Advance Summary Report
        </div>
        <div class="company-name">
            <?php echo e($company->legal_name ?? $company->display_name ?? ''); ?>

        </div>
        <div class="small-text">
            <?php echo e(trim(implode(', ', array_filter([$company->address_line1 ?? null, $company->address_line2 ?? null])))); ?>

        </div>
        <div class="small-text">
            As of Date: <?php echo e($as_of_date->format('d M Y')); ?>

        </div>
    </div>

    <div class="header-right">
        <?php if(!empty($company->logo)): ?>
            <img src="<?php echo e(public_path($company->logo)); ?>" height="70">
        <?php endif; ?>
    </div>
</div>

<!-- ================= FOOTER ================= -->
<div class="footer">
    <div class="footer-left">
        LaraOffice
    </div>

    <div class="footer-center">
        <span class="page-number"></span>
    </div>

    <div class="footer-right">
        Printed: <?php echo e(now()->format('Y-m-d H:i')); ?>

    </div>
</div>

<!-- ================= CONTENT ================= -->
<?php
    $currency = optional($company->baseCurrency)->symbol ?? 'Rs.';
?>

<table>
    <thead>
        <tr>
            <th>Emp Code</th>
            <th>EPF No</th>
            <th>Employee Name</th>
            <th>Dept</th>
            <th>Loan Type</th>
            <th>Loan No</th>
            <th>Start Date</th>
            <th>Period</th>
            <th>Approved (<?php echo e($currency); ?>)</th>
            <th>Installment (<?php echo e($currency); ?>)</th>
            <th>Payments</th>
            <th>Paid (<?php echo e($currency); ?>)</th>
            <th>Balance (<?php echo e($currency); ?>)</th>
            <th>Status</th>
        </tr>
    </thead>
    <tbody>
        <?php $__currentLoopData = $loan_summaries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $summary): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
            $employee = $summary['employee'];
            $employeeLoan = $summary['employee_loan'];
            $loan = $summary['loan'];
        ?>
        <tr>
            <td><?php echo e($employee->employee_code); ?></td>
            <td><?php echo e($employee->epf_no); ?></td>
            <td><?php echo e(trim($employee->first_name . ' ' . $employee->middle_name . ' ' . $employee->last_name)); ?></td>
            <td><?php echo e(optional($employee->department)->name); ?></td>
            <td><?php echo e(optional($loan)->name); ?></td>
            <td><?php echo e($employeeLoan->loan_number); ?></td>
            <td><?php echo e(optional($employeeLoan->start_date)->format('d/m/Y')); ?></td>
            <td><?php echo e($employeeLoan->repayment_period); ?></td>
            <td class="number"><?php echo e(number_format($summary['approved_amount'], 2)); ?></td>
            <td class="number"><?php echo e(number_format($employeeLoan->installment_amount, 2)); ?></td>
            <td class="number"><?php echo e($summary['payment_count']); ?></td>
            <td class="number"><?php echo e(number_format($summary['paid_amount'], 2)); ?></td>
            <td class="number"><?php echo e(number_format($summary['remaining_amount'], 2)); ?></td>
            <td><?php echo e(ucfirst($employeeLoan->status)); ?></td>
        </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </tbody>
</table>

<?php if(count($loan_summaries) == 0): ?>
    <div style="text-align: center; padding: 50px; font-size: 14px; color: #999;">
        No loan records found for the selected filters.
    </div>
<?php endif; ?>

</body>
</html>
<?php /**PATH /home/codeproh/va.laraoffice.com/app/Modules/HR/Reports/Providers/../Views/pdf/loan-advance-summary.blade.php ENDPATH**/ ?>