<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Financial Report</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            font-size: 12px;
            line-height: 1.4;
            color: #333;
        }
        .header {
            text-align: center;
            border-bottom: 2px solid #333;
            padding-bottom: 20px;
            margin-bottom: 30px;
        }
        .header h1 {
            margin: 0;
            color: #2d3748;
            font-size: 24px;
        }
        .header p {
            margin: 5px 0;
            color: #718096;
        }
        .summary {
            margin-bottom: 30px;
        }
        .summary-grid {
            display: table;
            width: 100%;
            border-collapse: collapse;
        }
        .summary-cell {
            display: table-cell;
            width: 25%;
            padding: 10px;
            text-align: center;
            border: 1px solid #e2e8f0;
        }
        .summary-cell h3 {
            margin: 0 0 5px 0;
            font-size: 14px;
            color: #4a5568;
        }
        .summary-cell .value {
            font-size: 18px;
            font-weight: bold;
            color: #2d3748;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        th, td {
            border: 1px solid #e2e8f0;
            padding: 8px;
            text-align: left;
        }
        th {
            background-color: #f7fafc;
            font-weight: bold;
            color: #4a5568;
        }
        .footer {
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #e2e8f0;
            text-align: center;
            color: #718096;
            font-size: 10px;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>Hotel Management System</h1>
        <p>Financial Report</p>
        <p>Period: <?php echo e(\Carbon\Carbon::parse($dateFrom)->format('M d, Y')); ?> - <?php echo e(\Carbon\Carbon::parse($dateTo)->format('M d, Y')); ?></p>
        <p>Generated: <?php echo e(now()->format('M d, Y H:i:s')); ?></p>
    </div>

    <div class="summary">
        <h2>Financial Summary</h2>
        <div class="summary-grid">
            <div class="summary-cell">
                <h3>Total Revenue</h3>
                <div class="value">$<?php echo e(number_format($summary['total_booking_revenue'], 2)); ?></div>
            </div>
            <div class="summary-cell">
                <h3>Advance Payments</h3>
                <div class="value">$<?php echo e(number_format($summary['total_advance_payments'], 2)); ?></div>
            </div>
            <div class="summary-cell">
                <h3>Due Amount</h3>
                <div class="value">$<?php echo e(number_format($summary['total_due_amount'], 2)); ?></div>
            </div>
            <div class="summary-cell">
                <h3>Net Revenue</h3>
                <div class="value">$<?php echo e(number_format($summary['net_revenue'], 2)); ?></div>
            </div>
        </div>
    </div>

    <div class="summary">
        <h2>Transaction Summary</h2>
        <div class="summary-grid">
            <div class="summary-cell">
                <h3>Total Transactions</h3>
                <div class="value"><?php echo e($summary['total_transactions']); ?></div>
            </div>
            <div class="summary-cell">
                <h3>Transaction Amount</h3>
                <div class="value">$<?php echo e(number_format($summary['total_transaction_amount'], 2)); ?></div>
            </div>
            <div class="summary-cell">
                <h3>Confirmed Bookings</h3>
                <div class="value"><?php echo e($confirmedBookings->count()); ?></div>
            </div>
            <div class="summary-cell">
                <h3>Report Period</h3>
                <div class="value"><?php echo e(\Carbon\Carbon::parse($dateFrom)->diffInDays($dateTo) + 1); ?> days</div>
            </div>
        </div>
    </div>

    <?php if($cardTypeAnalysis->count() > 0): ?>
    <div class="summary">
        <h2>Payment Method Analysis</h2>
        <table>
            <thead>
                <tr>
                    <th>Payment Method</th>
                    <th>Transactions</th>
                    <th>Total Amount</th>
                    <th>Percentage</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $cardTypeAnalysis; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cardType => $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><strong><?php echo e($cardType ?: 'Other'); ?></strong></td>
                        <td><?php echo e($data['count']); ?></td>
                        <td>$<?php echo e(number_format($data['amount'], 2)); ?></td>
                        <td><?php echo e($summary['total_transaction_amount'] > 0 ? number_format(($data['amount'] / $summary['total_transaction_amount']) * 100, 1) : 0); ?>%</td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>
    <?php endif; ?>

    <?php if($dailyRevenue->count() > 0): ?>
    <div class="summary">
        <h2>Daily Revenue Trend (Last 10 Days)</h2>
        <table>
            <thead>
                <tr>
                    <th>Date</th>
                    <th>Revenue</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $dailyRevenue->take(10); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $date => $revenue): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><strong><?php echo e(\Carbon\Carbon::parse($date)->format('M d, Y')); ?></strong></td>
                        <td>$<?php echo e(number_format($revenue, 2)); ?></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>
    <?php endif; ?>

    <div class="footer">
        <p>This report was generated automatically by the Hotel Management System</p>
        <p>For any questions, please contact the system administrator</p>
    </div>
</body>
</html> <?php /**PATH /home4/lvwxwpmy/public_html/hotelms/resources/views/backend/reports/pdf/financial.blade.php ENDPATH**/ ?>