# Implemented business rules

Original Markdown/HTML documents are reference material. The owner's choices take precedence.

- Production records **actual ingredients and actual portions**, confirmed by the owner. Recipe quantities only prefill editable inputs. Zero-yield failed batches still consume recorded ingredients.
- Each accepted QR request creates **a separate bill**, confirmed by the owner. Several bills can remain open at one table.
- Orders/payment do not deduct or reserve stock. Availability is checked on submission, QR acceptance and stock use. Accepted bills can compete for remaining stock; fulfillment refuses shortages atomically.
- Recipe items consume ingredients/disposable supplies when prepared. Retail and prepared portions consume finished stock/supplies at handover. Ceramic uses no container.
- Prepared portions consume ingredients during production and finished portions at sale; ingredients are never deducted twice.
- One bill-item row represents one physical unit. Notes apply to each selected unit of the menu item.
- Fully paid bills close after every unit is handed over or explicitly discarded by a manager. Prepared-item discard records waste without more ingredient deduction or an automatic refund.
- Full cancellation/refund is manager-only, before any stock use. Used stock is never silently restored.
- Unpaid loss is manager-only after all units are handed over/discarded, with a reason. It records only the unpaid remainder, without another stock movement.
- Physical counts preserve locked system quantity, actual count, difference, reason and actor. Blank means uncounted; zero means none remains.
- Purchase orders create neither stock nor debt. Accepted receipts create both using actual quantity/cost and exact conversion. Partial deliveries remain open; a reason can close undelivered remainder. Overdelivery requires another order.
- Supplier payments cannot exceed accepted-goods debt. Advances and posted-document corrections require a future explicit workflow.
- Money uses integer minor units; received quantity × unit cost rounds half up. Stock uses exact three-decimal base quantities and rejects finer conversion.
- Negative stock is blocked. Currency is fixed after financial documents exist.
- Staff create bills, review QR requests, receive payments and fulfill units. Managers additionally manage catalog, staff, purchases, stock, production, waste, refunds, loss and reports.
- Table capabilities use stored hashes and encrypted recovery values. Separate status capabilities expose one order only. Replacing a table code revokes its menu link while preserving existing status pages.
- Reports use Nairobi days. Pending/rejected QR and cancelled bills are excluded from billed value. Payments, refunds and losses use their own dates; served value counts handed-over units. Current balances are all-time and labeled.

Discounts/tax, gateways, custom role editing, multi-location accounting and deployment are outside this release.
