# Implementation status

Updated 15 October 2026. Canonical application: `C:/Users/Hp/Herd/cafe-erp`.

## Working release

- Connected MySQL `cafe_erp` and reproducible migrations.
- Structural Manager/Staff permissions and serving options; owner-selected currency/payment methods; no default account or sample transactions. The Beydan development database now has an optional, clearly documented sample catalog and ledger-backed sample opening stock.
- Local first-manager setup, individual login, hashed passwords, regenerated sessions, throttling, CSRF and current account/permission checks.
- Manager dashboard and a staff dashboard without management totals.
- Searchable/paginated categories, menu, inventory, suppliers, tables and staff CRUD; archival/reactivation preserves history.
- Categories, suppliers and tables use accessible add/edit modals. New categories and suppliers start active, and supplier email is optional. SweetAlert2 handles workspace notices and action confirmations.
- Menu photographs, descriptions, stock-derived/manual availability, versioned drink recipes and disposable supplies. The editor accepts an optional photo and multiple recipe ingredients alongside item details. The menu list shows each image before its name; Photo and Recipe open in Bootstrap modals, while archive/remove confirmations use SweetAlert2.
- POS product grid and order composer with per-item serving options, server price/currency snapshots, per-unit item notes, immediate or later payment, preparation/handover, completion, full pre-consumption refund/cancellation.
- Open POS orders can be reopened in the composer, including paid orders. Adding items keeps the same bill number and prior payments; only the new balance needs collecting. Once preparation starts, service, table, and progressed units remain locked while pending units and new items can still be revised. The revised total cannot fall below money collected, and superseded pending units remain cancelled rows for audit history. Revised bills print an updated receipt.
- Settings can store optional receipt address and phone. Receipts omit empty contact lines and show a compact QR code above the Mudnaan Technology URL.
- Sales list has period, sale status, payment status, and bill/table search filters, with a cancellation action for open sales before stock consumption. Paid cancellations record a full refund through the existing refund service.
- Purchase orders with four day-to-day filters, local Select2 item search, automatic purchase units, edit/cancel before receiving, exact conversions, partial accepted deliveries, private receipt attachments, actual receiving costs, close-short reasons and supplier payments against accepted debt.
- Versioned batch templates, actual input/output production, failed zero-yield batches, immutable actual input history and finished-portion stock.
- Auto-coded inventory items, physical count documents, ledger differences, inventory waste, reversible stock adjustments and waste corrections with retained history, prepared-item discard without double consumption, and manager unpaid-loss closure.
- Public mobile QR menu/cart, staff review queue, scoped status, printable/revocable encrypted table codes and several separate bills per table.
- Expense Management has a one-field type modal, a filtered expense list, edit and void actions, and audit history. Voided amounts leave the report without deleting their records.
- Separate Sales, Income and expenses, Inventory valuation, Suppliers, and plain-language Audit log pages. Each has focused filters and matching Excel/PDF downloads. Income and expenses includes recorded everyday expenses along with customer payments, supplier payments and refunds.
- Sales receipts print from the Sales list without navigating away; revised receipts do not show a special heading.
- Separate Bootstrap templates, CSS/JS, focused errors and isolated development previews.
- Removed unused controller/service shells.

## Verification

- Fresh MySQL installation through the actual CI4 migration runner.
- 35 PHP tests / 147 assertions, including 23 transactional MySQL domain scenarios, run after isolated manager setup.
- Sixteen complete working-browser scenarios covering setup/auth/CRUD/POS, catalog and menu editor, purchasing and document download, expense management and reporting, stock/waste corrections, production and QR orders.
- 35 read-only preview checks.
- PHP syntax checked across 241 application/test files; 36 concrete SQL model field mappings match the live schema.
- Verification databases are removed through guarded cleanup after testing. No test account, order or stock movement is inserted into `cafe_erp`.
- Desktop and mobile menu forms, production/reports and a 390px customer menu were visually inspected; the customer menu fits without horizontal overflow.

On a fresh installation, the owner creates the first manager at `http://cafe-erp.test/setup`. The current Beydan database has its manager and optional sample catalog. No bills, payments or purchases were fabricated.

## Boundaries

See BUSINESS-RULES.md for the owner's production and QR decisions. Stock is never negative and is not reserved by payment. Fulfillment checks remaining quantities atomically.

Discounts/tax, editable settled documents, receipt corrections/advances, supplier returns/credits, custom role editing, gateways and deployment are outside this release. The supplier balance owed to café therefore remains zero until credits or advances can be recorded. Multi-process load/concurrency testing has not been performed.

Table codes use the configured application URL. Phone access needs a reachable network address before café deployment.

## Folder transition

All active naming uses cafe-erp. The original cafe-erp-ci4 copy is held by this chat's working directory. Reopen Codex in the canonical folder before retiring that locked copy.
