# Hotel POS update — 15 October 2026

## Included in this package

1. **Direct billing permissions:** only users with the `administrator` or `cashier` role can bill restaurant orders or bar tabs. The bill action no longer opens the print dialog automatically. Users can still choose the separate Print Bill / Print Receipt action. The controller checks permissions server-side as well as hiding the button for other roles.
2. **Overselling setting:** Settings → POS & Shifts now has “Allow overselling when stock is zero or insufficient”. It defaults to ON to preserve the previous behaviour. Turn it OFF to reject stock deductions that would make tracked product stock or recipe ingredient stock negative.
3. **M-Pesa:** the project already contains Daraja STK Push, callback/status handling and an M-Pesa settings/status tab. Daraja credentials remain in the server `.env` rather than being stored in the database. Configure keys and callback URL using `.env.example`; run `php artisan config:clear` after changing them. Test in Sandbox before production.
4. **KRA eTIMS:** the project already has an eTIMS settings tab, invoice queue/status, retry and credit-note flow. Important: `EtimsService` currently posts to a configurable generic `/invoices` endpoint. This is an integration adapter, not proof of a completed/approved direct KRA integration. Before live use, the request/response mapping and authentication must be implemented and validated against the specific KRA eTIMS API/device integration assigned to the business. Do not enable live submission until KRA test acceptance is complete.
5. **Online/offline:** the existing browser queue keeps product-add actions made while offline and replays them when connectivity returns. This is limited offline queuing, not full offline operation or complete bidirectional database synchronization. Billing, payments, M-Pesa, eTIMS, inventory changes outside queued product-add actions, and conflict resolution still require online server access. A full offline-first sync requires a local database, durable idempotency keys, authenticated sync endpoints and conflict/reconciliation rules; it is not represented as complete in this update.

## Upgrade

Upload/replace the project files from this archive. No new SQL table is required for the overselling option because it uses the existing settings table. Back up the application and database before replacing production files. After upload, run from the project root:

```bash
php artisan optimize:clear
php artisan view:clear
```

If Composer dependencies have not changed, `composer install` is not required for this update. Test billing with administrator, cashier, manager and waiter accounts; test overselling ON and OFF in a non-production database first.
