# AccountingReports Module — Release Notes v2.5.0
**Release Date:** 28 April 2026
**Compatibility:** UltimatePOS / LewisPOS | Laravel 9/10 | PHP 8.0+

---

## What's New in v2.5.0

### Sri Lanka Cheque Printing — Full SL Compliance

This release delivers a **production-ready, Sri Lanka Banking Act compliant** cheque printing system. The previous skeleton implementation had a critical PHP bug (`$date` undefined) and printed no SL-standard formatting. v2.5.0 replaces it completely.

#### Key Compliance Features
| Requirement | v2.4.x | v2.5.0 |
|---|---|---|
| Page size 7.5×3.5 inch | ❌ | ✅ 190.5×88.9mm |
| MICR Clear Band (19.05mm) | ❌ | ✅ Enforced blank zone |
| DDMMYYYY 8-box date | ❌ | ✅ Individual bordered boxes |
| `Rs. X,XXX.XX/=` format | ❌ | ✅ SL standard |
| "Only" suffix | Partial | ✅ Enforced + dedup |
| Asterisk protection `***` | ❌ | ✅ Payee + Amount |
| A/C Payee Only crossing | Basic | ✅ Diagonal lines |
| Not Negotiable crossing | ❌ | ✅ |
| VOID watermark | ❌ | ✅ |

#### New: Per-Account Printer Calibration
Every printer pulls paper slightly differently. Users can now set **X/Y millimeter offsets** per bank account. Settings are saved to DB and loaded automatically. No more manually adjusting CSS between print runs.

#### New: Cheque Print Audit Trail
Every cheque printed is logged:
- Who printed it (User ID + name)
- When (timestamp)
- Payee name and amount
- Which bank account
- Crossing type
- IP address

This creates an **immutable fraud prevention log** visible in the print form.

---

## Upgrade Instructions

### Step 1 — Run New Migrations
Go to **Settings → Migration Manager** in your ERP, or run:
```bash
php artisan migrate --path=Modules/AccountingReports/Database/Migrations/2026_04_28_000001_create_cheque_print_templates_table.php --force
php artisan migrate --path=Modules/AccountingReports/Database/Migrations/2026_04_28_000002_create_cheque_print_audit_log_table.php --force
```

### Step 2 — Clear Caches
```bash
php artisan route:clear
php artisan view:clear
php artisan config:clear
```

### Step 3 — Test Cheque Printing
1. Navigate to **Accounting → Cheque Printing**
2. Select your bank account
3. Enter test payee and amount
4. Click **Print Cheque** — a new window opens with the formatted cheque
5. **Always test on a photocopy first** before printing on actual cheque leaves

### Step 4 — Set Calibration Offsets (Optional)
If your printer misaligns by a few mm:
1. Select the bank account on the printing form
2. The **Printer Calibration** panel appears
3. Set X (horizontal) and Y (vertical) offsets in mm
4. Click **Save Calibration** — stored per account

---

## Files Changed in This Release

| File | Type | Change |
|---|---|---|
| `Http/Controllers/ChequePrintingController.php` | Modified | Full rewrite — bug fixes + SL features |
| `Resources/views/cheque-printing/index.blade.php` | Modified | Premium redesign with calibration + preview |
| `Resources/views/cheque-printing/print.blade.php` | Modified | Full SL-compliant cheque output |
| `Routes/web.php` | Modified | +2 template routes |
| `Database/Migrations/2026_04_28_000001_*.php` | New | `cheque_print_templates` table |
| `Database/Migrations/2026_04_28_000002_*.php` | New | `cheque_print_audit_log` table |
| `module.json` | Modified | Version bumped to 2.5.0 |
| `composer.json` | Modified | Version bumped to 2.5.0 |
| `CHANGELOG.md` | New | Full version history |

---

## SL Bank MICR Reference

| Bank | Code | Account Digits |
|---|---|---|
| Bank of Ceylon (BOC) | 7010 | 10 |
| Commercial Bank | 7117 | 10 |
| HNB | 7083 | 10 |
| Sampath Bank | 7278 | 10 |
| Seylan Bank | 7287 | 10 |
| Nations Trust (NTB) | 7214 | 10 |
| People's Bank | 7135 | 10 |

---

## Known Limitations / Not Yet Implemented

- **Drag-and-drop field designer**: Field positions are currently configured via numeric mm values in the calibration panel. A visual drag-and-drop canvas is planned for v2.6.0.
- **Blank security paper / MICR line printing**: Full MICR E-13B font printing (for blank cheque paper) is not yet implemented. The current system targets pre-printed cheque leaves.
- **Sinhala / Tamil amount words**: English only in this release. Multi-language amount words planned for v2.6.0.

---

## Support

For issues with cheque alignment, always:
1. Use the **Calibration Offset** feature (X/Y mm) before adjusting any code
2. Test on photocopy first
3. Check the **MICR Reference** table for your bank code
