# Invoice PDF - Refundable Status Update

## Overview
Updated the invoice PDF template to display actual refundable status for each booking item instead of hardcoded values.

## Changes Made

### 1. Service Table Header
**Changed:** Column header from "QTY" to "Refundable"

**Before:**
```blade
<th style="width: 8%;">QTY</th>
```

**After:**
```blade
<th style="width: 8%;">Refundable</th>
```

### 2. Hotel Bookings - Refundable Status Display
**Changed:** Replaced hardcoded quantity with dynamic refundable badge

**Before:**
```blade
<td>{{ $hotelBooking->nights }}</td>
```

**After:**
```blade
<td>
    <span style="padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 9px; {{ $hotelBooking->is_refundable ? 'background-color: #d4edda; color: #155724;' : 'background-color: #f8d7da; color: #721c24;' }}">
        {{ $hotelBooking->is_refundable ? 'Yes' : 'No' }}
    </span>
</td>
```

### 3. Car Bookings - Refundable Status Display
**Changed:** Replaced hardcoded "1" with dynamic refundable badge

**Before:**
```blade
<td>1</td>
```

**After:**
```blade
<td>
    <span style="padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 9px; {{ $carBooking->is_refundable ? 'background-color: #d4edda; color: #155724;' : 'background-color: #f8d7da; color: #721c24;' }}">
        {{ $carBooking->is_refundable ? 'Yes' : 'No' }}
    </span>
</td>
```

### 4. Service Bookings - Refundable Status Display
**Changed:** Replaced hardcoded "1" with dynamic refundable badge

**Before:**
```blade
<td>1</td>
```

**After:**
```blade
<td>
    <span style="padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 9px; {{ $serviceBooking->is_refundable ? 'background-color: #d4edda; color: #155724;' : 'background-color: #f8d7da; color: #721c24;' }}">
        {{ $serviceBooking->is_refundable ? 'Yes' : 'No' }}
    </span>
</td>
```

### 5. Removed Hardcoded "Time Limit" Row
**Removed:** The hardcoded "Time Limit: Non Refundable" row from notes section

**Before:**
```blade
<table class="notes-section">
    <tr>
        <td class="notes-title" style="width: 20%;">Time Limit</td>
        <td>Non Refundable</td>
    </tr>
    <tr>
        <td class="notes-title">Rep</td>
        <td>Sameem</td>
    </tr>
    ...
</table>
```

**After:**
```blade
<table class="notes-section">
    <tr>
        <td class="notes-title" style="width: 20%;">Rep</td>
        <td>{{ $booking->creator ? $booking->creator->emp_name : 'N/A' }}</td>
    </tr>
    ...
</table>
```

### 6. Dynamic Rep Name
**Changed:** Replaced hardcoded "Sameem" with dynamic creator name

**Before:**
```blade
<td>Sameem</td>
```

**After:**
```blade
<td>{{ $booking->creator ? $booking->creator->emp_name : 'N/A' }}</td>
```

## Visual Changes

### Invoice Table Structure

**Before:**
```
┌──────────┬─────────────┬──────────┬──────────┬─────┬─────────────┬──────────┐
│ Hotel    │ Description │ Check in │ Check out│ QTY │ Nightly Rate│ Sub Total│
├──────────┼─────────────┼──────────┼──────────┼─────┼─────────────┼──────────┤
│ Taj Hotel│ Deluxe/BB   │ 01 Jan   │ 05 Jan   │  5  │ 200.00      │ 1,000.00 │
│ Transfer │ Airport-Hotel│ 01 Jan   │ -        │  1  │ 50.00       │ 50.00    │
└──────────┴─────────────┴──────────┴──────────┴─────┴─────────────┴──────────┘
```

**After:**
```
┌──────────┬─────────────┬──────────┬──────────┬────────────┬─────────────┬──────────┐
│ Hotel    │ Description │ Check in │ Check out│ Refundable │ Nightly Rate│ Sub Total│
├──────────┼─────────────┼──────────┼──────────┼────────────┼─────────────┼──────────┤
│ Taj Hotel│ Deluxe/BB   │ 01 Jan   │ 05 Jan   │ [No]       │ 200.00      │ 1,000.00 │
│ Transfer │ Airport-Hotel│ 01 Jan   │ -        │ [Yes]      │ 50.00       │ 50.00    │
└──────────┴─────────────┴──────────┴──────────┴────────────┴─────────────┴──────────┘
```

### Badge Styling
- **Refundable (Yes):** Green background (#d4edda) with dark green text (#155724)
- **Not Refundable (No):** Red background (#f8d7da) with dark red text (#721c24)
- Font size: 9px (smaller to fit in column)
- Padding: 2px 6px
- Border radius: 3px

## Files Modified
1. `resources/views/vouchers/invoice.blade.php`

## Benefits
1. ✅ Shows actual refundable status for each booking item
2. ✅ Removed misleading hardcoded values
3. ✅ Visual color coding (green/red) for quick identification
4. ✅ Dynamic rep name from booking creator
5. ✅ Cleaner notes section without redundant information
6. ✅ Consistent with voucher PDF styling

## Testing Checklist
- [ ] Generate invoice with refundable hotel booking
- [ ] Generate invoice with non-refundable hotel booking
- [ ] Generate invoice with refundable car booking
- [ ] Generate invoice with non-refundable car booking
- [ ] Generate invoice with refundable service booking
- [ ] Generate invoice with non-refundable service booking
- [ ] Generate invoice with mixed refundable/non-refundable items
- [ ] Verify badge colors display correctly in PDF
- [ ] Verify rep name shows correctly
- [ ] Verify notes section displays properly

## Notes
- The refundable status is now pulled from the database field `is_refundable`
- Badge styling matches the voucher PDFs for consistency
- Smaller font size (9px) ensures the badge fits within the column width
- The "Time Limit" row has been completely removed as it was hardcoded and misleading

