# KomTech Hotel Management System
## Complete Documentation

---

## Table of Contents
1. [System Overview](#system-overview)
2. [Installation](#installation)
3. [Admin Access](#admin-access)
4. [Features & Modules](#features--modules)
5. [How to Use Each Module](#how-to-use-each-module)
6. [Settings Configuration](#settings-configuration)
7. [Email Notifications](#email-notifications)
8. [Currency Configuration](#currency-configuration)
9. [Troubleshooting](#troubleshooting)

---

## System Overview

**Tech Stack:**
- Laravel 10.x
- PHP 8.2+
- MySQL
- TailwindCSS
- Spatie Permission (Roles)

**Default Admin Login:**
- Email: `admin@komtechhotel.com`
- Password: `123456`

---

## Installation

### Local Development (XAMPP/WAMP)

1. **Copy project to htdocs:**
   ```
   C:\xampp\htdocs\hotel-management\
   ```

2. **Create Database:**
   - Open phpMyAdmin (http://localhost/phpmyadmin)
   - Create database: `hotel_management`

3. **Install Dependencies:**
   ```bash
   cd C:\xampp\htdocs\hotel-management
   composer install
   ```

4. **Run Migrations & Seeders:**
   ```bash
   php artisan migrate
   php artisan db:seed
   ```

5. **Start Server:**
   ```bash
   php artisan serve
   ```
   Access at: http://localhost:8000

### Production Deployment

1. Upload files to server
2. Configure `.env` with production database credentials
3. Set `APP_ENV=production` and `APP_DEBUG=false`
4. Run migrations and seeders

---

## Admin Access

**Login URL:** `http://localhost:8000/login`

| Role | Permissions |
|------|-------------|
| Super Admin | Full access to all modules |
| Manager | Can manage bookings, rooms, POS, view reports |
| Receptionist | Front desk operations, check-in/out |
| Cashier | POS transactions only |

---

## Features & Modules

### 1. Dashboard
- Overview statistics (rooms, bookings, revenue)
- Quick actions
- Recent activity

### 2. Room Management
- **Room Types** - Create/edit room categories with prices
- **Rooms** - Manage individual rooms and their status

### 3. Bookings
- View all bookings
- Confirm/Cancel bookings
- Filter by status, date, search

### 4. Reception
- Walk-in check-in
- Check-out process
- Folio management (charges & payments)
- Extend stay

### 5. Point of Sale (POS)
- **Bar** - Food & beverages
- **Laundry** - Laundry services
- **Mini Mart** - Shop items
- Transactions and receipts

### 6. Accounting
- Revenue reports
- Expense tracking
- Payment management

### 7. Human Resources
- Staff management
- Attendance tracking
- Shift management
- Payroll/Salary records

### 8. Settings
- Hotel information
- Bank details (for online bookings)
- Check-in/out times
- Tax rates

---

## How to Use Each Module

### Room Types (Change Prices)

1. Go to **Accommodation** → **Room Types**
2. Click **Edit** on any room type
3. Update **Base Price (₦)**
4. Click **Update Room Type**
5. Price automatically updates on frontend

### Online Bookings

1. Guest books on website
2. Admin receives email notification
3. Go to **Bookings** → Find the booking
4. Click **Confirm** to approve (guest gets email)
5. Or click **Cancel** to reject (guest gets email)

### Check-in Process

1. Go to **Reception**
2. Find confirmed booking
3. Click **Check In**
4. Assign room
5. Collect payment
6. Complete check-in

### POS Transactions

1. Go to **POS System**
2. Select outlet (Bar/Laundry/Mini Mart)
3. Search/add products
4. Add guest info (optional)
5. Complete transaction
6. Print receipt

### Payroll

1. Go to **HR** → **Salaries**
2. Click **Create Salary**
3. Select staff
4. Enter salary details
5. Save record

### Bank Details (Online Bookings)

1. Go to **Settings**
2. Scroll to **Bank Payment Details**
3. Fill in:
   - Bank Name
   - Account Name
   - Account Number
   - Account Type
   - Sort Code
   - Payment Instructions
4. Click **Save All Settings**

Guests will see these details on the booking confirmation page.

---

## Settings Configuration

### General Settings
| Setting | Location | Purpose |
|---------|----------|---------|
| Hotel Name | Settings | Display name |
| Address | Settings | Hotel address |
| Phone/Email | Settings | Contact info |
| Check-in Time | Settings | Default: 14:00 |
| Check-out Time | Settings | Default: 12:00 |
| Tax Rate | Settings | Default: 16% |
| Currency | Settings | NGN/USD/etc |

### Bank Details
These appear on the booking confirmation page for guest payments.

---

## Email Notifications

### Current Email Triggers
| Event | Recipient |
|-------|-----------|
| New online booking | Hotel admin |
| Booking confirmed | Guest |
| Booking cancelled | Guest |

### Email Configuration

**Local Testing (Mailpit):**
- Emails captured at: http://localhost:8025
- Already configured in `.env`

**Production:**
Update `.env`:
```env
MAIL_MAILER=smtp
MAIL_HOST=smtp.yourprovider.com
MAIL_PORT=587
MAIL_USERNAME=your-email@domain.com
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="booking@yourhotel.com"
MAIL_FROM_NAME="Your Hotel Name"
```

---

## Currency Configuration

**Currency:** Nigerian Naira (₦)

To change:
1. Go to **Settings**
2. Find **Currency** dropdown
3. Select desired currency
4. Save

---

## Troubleshooting

### Common Issues

**"Route not found" error**
- Clear cache: `php artisan route:clear`

**Emails not sending**
- Check `.env` mail configuration
- For local testing, check http://localhost:8025

**Room prices not updating**
- Go to Room Types → Edit → Update price
- Clear view cache: `php artisan view:clear`

**Permission denied errors**
- User needs appropriate role
- Contact Super Admin

### Useful Commands
```bash
php artisan config:clear    # Clear config cache
php artisan route:clear     # Clear route cache
php artisan view:clear     # Clear view cache
php artisan cache:clear    # Clear application cache
php artisan migrate         # Run migrations
php artisan db:seed        # Seed database
```

---

## File Structure

```
hotel-management/
├── app/
│   ├── Http/Controllers/
│   │   ├── Admin/          # Admin controllers
│   │   ├── Auth/           # Authentication
│   │   ├── Frontend/       # Public website
│   │   ├── HR/             # HR module
│   │   ├── POS/            # Point of Sale
│   │   ├── Reception/      # Front desk
│   │   └── Accounting/     # Finance
│   ├── Mail/               # Email classes
│   ├── Models/             # Database models
│   └── Services/            # Business logic
├── resources/views/
│   ├── admin/              # Admin panel views
│   ├── frontend/            # Public website
│   └── emails/              # Email templates
├── routes/
│   └── web.php             # All routes
└── database/
    ├── migrations/         # Database tables
    └── seeders/            # Sample data
```

---

## Support

For technical support or feature requests, contact the developer.

---

*Document Version: 1.0*
*Last Updated: March 2026*
