Scrap ERP v1.12.9 — Partner Profit Allocation

UPDATE
Back up the existing ERP folder and database. Upload this complete scrap-erp
folder, replacing application files. Keep storage/config.php and
storage/installed.lock. No database updater is required when updating v1.12.8.
The Partner Profit Payable account is created on the first successful allocation.

NEW INSTALLATION
Upload scrap-erp, create an empty MySQL database and open install.php.

USE
Open Investment > Profit Allocation. Select a profit month. Enter the total to
allocate and individual partner amounts. They must match; the total cannot
exceed available profit. Partial distribution is supported: 10000 profit with
7000 allocated leaves 3000 unallocated for that same month.
Select Pay / Transfer beside a partner allocation. Enter any combination of
cash/bank, investment and Dasti amounts. Leave unused destinations zero or blank.
Any remainder stays as unpaid profit. Each destination creates its own OPR code,
linked to the allocation code. Only Owner can allocate or settle profit.

Partner ledgers separately track investment, Dasti, actual profit paid and
available allocated profit. Investment reports include these balances too.
Only the cash/bank portion enters Business Transactions and Cash/Bank Book.
Internal transfers do not create artificial cash receipts/payments or expenses.
The old Profit Taken entry option now routes through Profit Allocation; existing
Profit Taken records are preserved and counted against their recorded month.

ACCOUNTING AND SCOPE
Profit uses posted income less expenses, matching Dashboard Monthly Profit.
Allocation debits equity account 3200 and credits liability account 2500.
Settlement debits 2500 and credits cash/bank, 3100 investment or 1710 Dasti.
These entries do not alter monthly profit. Full allocations reserve their value,
including amounts not paid yet; they cannot be allocated a second time.
Months are independent. Unallocated amounts stay with their original month.
Losses are displayed but are not automatically allocated to partners.
If source profit changes after allocation, the page flags it for review and
limits new allocations against the revised profit. Existing allocations remain
unchanged. This release does not add allocation reversal/edit controls.

VALIDATION
PHP 8.2 syntax checks passed. Local PHP/SQLite tests checked the 10000/7000
example, 1500 Dasti + 2000 investment split, 500 cash settlement, remaining
balances, over-allocation/payment rejection, rollback, company isolation,
partner report integration, and money-movement-only transaction listing.
Not tested on your live MySQL server or in a graphical browser.
