# Rental Manager V2.0

## Main improvements

- Charge definitions are now completely separate for Heliopolis and Daher.
- The sidebar contains a Charge Items submenu for each building.
- Shared expenses support a professional apartment selector with search, selected count, Select All, Rental Only, Ownership Only, and Clear All actions.
- Every shared item remembers its own participating apartments for later months.
- Existing shared items can be expanded and edited, reconciled, or removed from a draft month.
- Charge-item behavior is editable directly from the table with switches for Shared, Carry Forward, Receipt, Reports, and Active.
- Monthly tables show a dash when an item does not apply to an apartment and show zero when it applies with a zero amount.
- Receipt numbers are safely scoped to each building, matching the separate receipt sequences in Settings.
- Reports calculate totals across the full filtered result and export the same filters to Excel.
- A private administrator login protects tenant, rent, receipt, and report data.
- A read-only `php artisan rental:verify` command checks the V2.0 database after deployment.

## Safe upgrade procedure

1. Download a database backup from the current app before changing files.
2. In the server `.env` file, add:

   ```env
   ADMIN_USERNAME=admin
   ADMIN_PASSWORD="CHOOSE_A_STRONG_PRIVATE_PASSWORD"
   ```

   Use a private password and keep the quotation marks if it contains spaces or `#`.
3. Upload and extract the V2.0 ZIP into `public_html/rental-manager`, overwriting matching application files.
4. From the project directory, run:

   ```bash
   php artisan optimize:clear
   php artisan migrate --force
   php artisan rental:verify
   php artisan optimize
   ```

5. Open the site and sign in using the administrator credentials added to `.env`.

The migrations preserve apartments, occupants, contracts, monthly accounts, payment history, and receipts. Existing global charge definitions are split and reassigned to the correct building.
