# IBF and ERM Billing Codes - Implementation Complete

## Summary
Successfully integrated IBF (Intermediary Bank Fees) and ERM (Exchange Rate Margins) billing codes into the wire transfer flow.

## Updated Flow
The wire transfer now follows this sequence:

1. **COT** (Cost of Transaction) - `dashboard/cot.php` → Progress: 30%
2. **IMF** (International Monetary Fund) - `dashboard/imfcode.php` → Progress: 30%
3. **IBF** (Intermediary Bank Fees) - `dashboard/ibfcode.php` → Progress: 50%
4. **ERM** (Exchange Rate Margins) - `dashboard/ermcode.php` → Progress: 60%
5. **TAX/VAT** - `dashboard/tax.php` → Progress: 70%
6. **Wire Preview** - `dashboard/wire-preview.php` → Generates OTP
7. **OTP Verification** - `dashboard/pin.php` → Final verification

## Files Modified

### 1. dashboard/imfcode.php
- Changed redirect from `tax.php` to `ibfcode.php`
- Progress percentage: 30%

### 2. dashboard/ibfcode.php
- Redirects to `ermcode.php`
- Updated progress percentage to 50%

### 3. dashboard/ermcode.php
- Redirects to `tax.php`
- Updated progress percentage to 60%

### 4. dashboard/tax.php
- Changed redirect from `ibfcode.php` to `wire-preview.php`
- Updated progress percentage to 70%

## Database Columns
The following columns already exist in the `account` table:
- `ibf` - Stores IBF billing code
- `erm` - Stores ERM billing code

## Admin Configuration
Admins can set billing codes through:
- `dashboard/billing.php` - Options 5 (IBF) and 6 (ERM) available

## Testing
To test the complete flow:
1. Login with test account (stanlee / PIN: 2486)
2. Initiate a wire transfer
3. Enter COT code when prompted
4. Enter IMF code when prompted
5. **NEW:** Enter IBF code when prompted
6. **NEW:** Enter ERM code when prompted
7. Enter TAX/VAT code when prompted
8. Enter OTP code sent to email
9. Transfer completes successfully

## Notes
- Each billing code page validates the code against the database
- Progress indicator shows completion percentage
- All session data is preserved throughout the flow
- Email notifications are sent at the wire-preview stage
