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.

The close session flow is a multi-step wizard that guides the user through closing out their POS session, counting cash, and generating a session report.

Permissions

Closing a session requires the close_session permission. The close session option appears in the floor plan header’s system menu.

Wizard steps

The close session flow uses a reducer-based state machine with seven states:
1

Loading

Fetches session data from the backend: open order count, payment totals by method, and cash denomination configuration.
2

Warning (conditional)

If there are open (unpaid) orders, the wizard pauses and shows a warning. The user must acknowledge before continuing.
3

Cash counting

Displays the cash denomination counting interface. Users enter counts per denomination (bills and coins) using a numpad. The system calculates the expected vs. actual cash totals.
4

Manager override (conditional)

If required by POS configuration, a manager must approve the session close via PIN or card authentication.
5

Closing

Submits the close session request to the backend with cash counts and optional manager override credentials.
6

Print report (optional)

Prints the session report with payment breakdowns, expected vs. actual totals, and discrepancies.
7

Done

Session is closed. The user is redirected to the login screen.

Cash counting

The denomination counting interface supports:
  • Pre-configured denominations from cashbox_lines in the Odoo session
  • Expression input with + and operators for adjustments (e.g., 5+3 = 8 bills)
  • Manual cash entry as an alternative to denomination counting
  • Real-time totals comparing expected cash (from payment lines) vs. counted cash

API endpoints

EndpointPurpose
POST /pos-api/v1/session/close/prepareFetch session data, open order count, payment totals
POST /pos-api/v1/session/closeSubmit close with cash counts and optional manager override
POST /pos-api/v1/session/reportFetch session report data for printing
POST /pos-api/v1/session/commentPost a comment to the session

Source files

src/features/management/screens/SessionCloseScreen.tsx  # Main UI
src/features/management/screens/closeSessionReducer.ts  # Wizard state machine
src/domain/sessions/closeSessionUtils.ts                # Cash denomination utilities
src/domain/sessions/models.ts                           # Type definitions