Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.laportenard.com/llms.txt

Use this file to discover all available pages before exploring further.

Source: nu_pos_react/src/state/machines/orderMachine.ts

Order states

  ┌──────┐    ┌─────────┐    ┌──────────┐    ┌──────┐    ┌───────────┐
  │ idle │───►│ editing │───►│ checkout │───►│ paid │───►│ finalized │
  └──────┘    └─────────┘    └──────────┘    └──────┘    └───────────┘
StateDescription
idleNo draft loaded
editingBuilding or modifying the draft
checkoutTicket prepared / sent to kitchen
paidPayment collected — no edits allowed
finalizedTerminal archival

Kitchen status mapping

StateStatusNotes
editing (before send)open
checkout entrysent
Edits after sendchangedAny line change post-checkout flips to changed
paid entrypaidEdits blocked
finalizedpaidUnchanged

Order metadata

Guest count and staff assignment are set when an order is created via the StartOrderModal. The guest count can also be edited after creation by tapping the guest count indicator in the order panel header. This reopens the same modal in edit mode, pre-filled with the current count. The SET_TABLE_META action updates guestCount and staffName on the active order.

Core events

EventGuard / Notes
ORDER_NEW, ORDER_LOAD, ORDER_CLEAROrder lifecycle
LINE_ADD, LINE_SET_QTY, LINE_REMOVELine editing
ORDER_SET_CUSTOMER, PRICING_CONTEXT_SETCustomer / metadata
GO_CHECKOUTGuard: must have at least one item
GO_EDITINGReturn to editing from checkout
MARK_PAID, FINALIZEPayment flow
DRAFT_SAVE, DRAFT_SAVEDAutosave

Business rules

  • Entering paid forces status = "paid" — no further edits are allowed.
  • Draft loads normalize missing status to "open".
  • Split behavior: Source check becomes "changed", destination checks inherit "sent" (not treated as new tickets).
  • After payment is complete and the user taps Done, the app submits the order to Odoo. On success it navigates back to the floor plan, preserving area context (/?area=...) when available.

Configurable kitchen notifications

The send_changes_to_kitchen setting on the shared POS config (nu.pos.config) controls whether non-quantity operations notify the kitchen:
SettingBehavior
true (default)Splitting, removing, or transferring items marks orders as "changed" — kitchen is notified
falseThese operations preserve the original status (e.g., "sent") without triggering kitchen notifications
Configure in Odoo: Point of Sale > Configuration > select config > “Send non-quantity changes to kitchen” checkbox. This setting applies to:
  • Splitting a sent order (source order status)
  • Removing items from a sent order
  • Adding items to a sent order
  • Transferring items between orders

Kitchen provenance

Order items carry optional kitchenTicketId and kitchenSentAt fields to remember the ticket and time they were originally sent. This is used when splitting a sent check — the new checks know which kitchen ticket their items came from.