# Stock balance visibility fix — 11 November 2026

## Reported symptoms
- POS showed zero available stock while the Stock feature showed a positive balance.
- Transfers reported zero/insufficient stock although the source branch showed stock.

## Changes
- POS branch stock totals now include all stock rows belonging to the active business branch, including rows still held in legacy department stores.
- Stock transfers now calculate source availability across every store belonging to the source branch, debit the actual source rows (main store first), and credit the destination branch's main stock store.
- When a POS sale is billed from the branch main store but a legacy store still contains stock, the stock service moves only the required quantity into the main store before recording the sale. Both transfer legs are recorded.
- No database migration is required for these code changes.

## Validation
- PHP syntax checks passed for StockService, Restaurant OrderController, and StockTransferController.
- ZIP integrity checked after packaging.
- Live database and browser testing were not available in this environment.

## Installation
Back up the current website and database. Upload and extract the ZIP, then run:
`php artisan optimize:clear`
`php artisan optimize`

After installation, test with a product whose stock is visible in Stock but previously appeared as zero on POS; also transfer a small quantity between branches and verify source and destination balances.
