Repository navigation
Description
Problem or motivation
Operators have raised conflicting operational expectations around whether the POS should permit billing/checkout (Cobrar) while items are still pending or in progress in the kitchen:
- Table-service / fulfillment-first venues: Some operators expect that cashiers cannot charge a table until all items are marked as delivered (
served/entregado), preventing premature billing or closing orders where the kitchen missed an item. - Printer-only venues (KDS disabled): Many operators do not use a Kitchen Display System at all (
kds_enabled = 'false') and rely exclusively on paper KOT slips. In a printer-only kitchen, there is no screen for kitchen staff to transition item states (pending \u2192 preparing \u2192 ready \u2192 served). If checkout required items to be delivered, printer-only businesses would be completely blocked from taking payments:"mutfak ekran\u0131 sistemi kapal\u0131ysa b\u00f6yle olmal\u0131 ama \u00e7\u00fcnk\u00fc bu \u00f6zelli\u011fi kullanmayan i\u015fletmeler var yaln\u0131zca yaz\u0131c\u0131 kullan\u0131yoruz." (If the kitchen display system is off, it should be like this [allow billing], because there are businesses that do not use this feature, we only use a printer.)
Current behavior
In FloCafe today:
- Bill generation and payment settlement (
/bills/generateand/bills/:id/payment) allow charging at any time. - When full payment is collected, FloCafe automatically transitions all remaining
pending,preparing, andreadyitems toservedand marks the order ascompleted. - This ensures prepaid, postpaid, KDS-enabled, and printer-only stores all function seamlessly without getting blocked.
Desired outcome
Provide an optional operational setting for venues that want to enforce delivery before settlement, while guaranteeing that printer-only setups are never broken:
- Configurable setting: An opt-in setting in Operations/POS Settings:
require_kitchen_delivered_before_settlement(default:false). - Automatic KDS bypass: If
kds_enabled = 'false', the delivery check is automatically bypassed, even if the setting is turned on. - Prepaid bypass: Prepaid / counter orders (
billing_type === 'prepaid') are paid upfront before kitchen dispatch, so the check only applies to postpaid checkout. - Manager override: If active, the checkout modal blocks settlement with a clear message (e.g. "Cannot checkout: 2 items still in preparation in kitchen"), but allows an Owner/Manager PIN override for exceptional customer situations.
Proposed technical approach
- Settings table: Add
require_kitchen_delivered_before_settlementboolean setting (default:false). - Backend check (
main/routes/bills.ts):- In
POST /api/bills/generateand/orPOST /api/bills/:id/payment:- If
getSettingValue('require_kitchen_delivered_before_settlement') === 'true'ANDgetSettingValue('kds_enabled') === 'true':- Query
order_itemsfor the order: check if any active items are inpending,preparing, orready. - If found and no valid manager
override_pinis supplied, return 409 Conflict with details on unfulfilled items.
- Query
- If
- In
- Frontend (
TableCheckoutModal.tsx/OrderCard.tsx):- Surface a warning/block if the order has undelivered kitchen items when the setting is active, offering an option to enter a Manager PIN to proceed.
Area
POS / Checkout, Kitchen Display (KDS) & Stations
Activity
khaira777 commentedon Oct 5, 2026
Closed as completed. Shipped in PR #941 (optional kitchen delivery enforcement before billing, KDS bypass, and manager override PIN).