Every order in La Comanda follows a structured lifecycle that connects the front-of-house waiter to the kitchen and barista stations. From the moment a waiter opens the table map to the moment food and drinks are delivered, each step is tracked in real time — ensuring nothing gets lost and every station sees exactly what it needs to prepare.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JAQA20/LaComanda/llms.txt
Use this file to discover all available pages before exploring further.
Order Lifecycle
Select a table
The waiter opens
views/index.php to see the interactive table map. Each table is displayed with its current status: disponible (free and ready to accept a new order) or ocupada (currently has an active order in progress). The waiter taps or clicks a disponible table to begin a new order.Add products
With a table selected, the waiter browses the product catalog, which is grouped by category. Products for each category are loaded on demand via:Replacing
{slug} with the category’s URL slug (e.g. cafes, bebidas, platos-principales). The waiter adds the desired quantity of each item before proceeding.Submit the order
When the waiter clicks Submit, the front-end serialises the cart and POSTs it as JSON to:The request body must include the following fields:
See Item Text Format below for the exact
| Field | Type | Description |
|---|---|---|
mesa | integer | Table number |
items | string | One line per item in "Product Name x Quantity" format |
notas | string | Optional free-text notes for the kitchen |
usuario_id | integer | ID of the logged-in waiter (from session) |
items string syntax.Kitchen and barista prepare
As soon as the order is saved, items automatically appear on the correct preparation screen. The routing is determined by each product’s category slug:
- Kitchen screen (
views/cocina.php) — receives all items whose category slug is notcafesorbebidas(and notmesas). - Barista screen (
views/barista.php) — receives items from categories with slugcafesorbebidas.
Mark ready
Kitchen staff progress each order through two actions:
- En preparación — cooking has started.
- Listo — food is plated and ready for collection.
Deliver
Once items are marked listo, the waiter (or an admin) calls:with the fields
mesa (table number) and area (e.g. cocina or barista) to mark that sub-order as delivered. When all items across both stations reach entregado, the table’s status automatically returns to disponible and is available for the next party.Order Status States
Each order line (detalle_orden) carries an estado_item that moves through a defined set of states. The table-level estado_general is derived dynamically from those line states and is never stored separately.
| State | Description |
|---|---|
pendiente | Order received, not yet being prepared |
en_preparacion | Kitchen or barista has started preparing the item |
listo | All items are ready and awaiting delivery |
entregado | Item has been delivered to the table |
entregada | Full order delivered — every item has reached entregado |
Order Routing Logic
WhenguardarOrden.php saves an order, it creates one detalle_orden row per item and sets estado_item = 'pendiente' for each. Routing is then handled by the database view vw_detalle_preparacion, which calculates an area_preparacion column for every item using the following logic:
'barista'— ifcategoria.slug IN ('cafes', 'bebidas')'ignorar'— ifcategoria.slug = 'mesas''cocina'— for all other category slugs
area_preparacion value, so neither station ever sees the other’s items.
Item Text Format
Theitems field sent to guardarOrden.php is a plain-text string with one item per line, using the format Product Name x Quantity:
Viewing Order History
Admins can review the full order history fromviews/admin/ordenesAdmin.php. The page fetches data from:
| Metric | Description |
|---|---|
| Total orders | All orders ever placed in the system |
| Revenue | Sum of delivered order totals |
| Delivered count | Orders with estado_general = 'entregada' |
| Pending count | Orders still in progress |
Each order’s overall
estado_general is calculated dynamically from its detalle_orden items — it is not stored separately.