Commission System - UPDATE v3.2
================================

AutoCount Product Code Commission Mapping

Purpose
-------
AutoCount invoice payment status continues to use the FULL invoice amount/outstanding balance.
Commission calculation can now use only selected AutoCount Product Code rows. SST/tax and non-commission items such as subscription are excluded from the commission base.

Setup
-----
Administration > Integrations > AutoCount Cloud Accounting
Enter Commission Product Code(s), one code per line.

Example
-------
PKG-A
PKG-B

If invoice contains:
PKG-A RM10,000 + SUB RM500 + SST RM800 = Invoice RM11,300
then:
- payment gate waits until AutoCount outstanding = RM0 on RM11,300
- commission base = RM10,000 (PKG-A subTotalExTax only)

Safety
------
- Exact Product Code matching, case-insensitive.
- Commission amount uses AutoCount subTotalExTax (before SST/tax).
- If no configured Product Code matches an invoice, sync shows COMMISSION MAPPING REQUIRED and does not advance the payment gate.
- If a project is already in a draft/paid Payment Batch, changed AutoCount invoice/package amounts do not rewrite the commission snapshot; the project is flagged COMMISSION LOCKED for review.
- Existing projects are migrated with commission_base_amount = existing invoice amount, so historical calculations remain unchanged until an AutoCount mapped sync updates an eligible project.

Install
-------
Back up files + database, extract this UPDATE over the current v3.1 installation, keep config/database.php, storage/installed.lock, storage/integration-secret.key and uploads/. Refresh once to run migration.
