Feat/pos order types compact header split payment - #255
Open
tushar-git26 wants to merge 35 commits into
Open
Conversation
The React POS never read POS Profile's built-in `customer` field, so the cashier had to pick a customer on every order. Upstream added a per-order-type variant in ury-erp#75 (aa082f6) but reverted it in ury-erp#78 (13ef5f3). Apply the profile's customer as a *fallback* only: - on profile load, when no customer is selected - on resetOrderState, so the next order starts pre-filled Crucially it is not reactive, so "Change" (which sets the customer to null) is not immediately overridden and the cashier can still pick anyone. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
loadTableOrder() blanked selectedCustomer whenever the chosen table had no existing order, so the POS Profile default was lost the moment a table was picked. clearTableOrder() and the error path did the same. Fall back to the profile's customer in all three places, and when an existing order carries no customer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The server has exposed table_transfer since the Vue POS, but the React POS never called it. Add a Switch action on occupied tables that lists the free tables of the same room -- the only transfer the server accepts -- with dine-in and take-away grouped separately, since parking a Dine In order on a take-away table does not change its order type. Also fix the room chips: table counts were cached in sessionStorage and never invalidated, and because 0 is a valid number the "do I have every room?" check passed, so a room that gained its first table stayed at 0 forever. Keep the count in step with the tables actually loaded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The note was sent to the server but never rendered, so a cashier had no way to tell whether it had been captured. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A large party often occupies several tables but wants one bill. Nothing in URY could do this: table_transfer refuses an occupied target, so two orders could never be brought together. Add merge_invoices(primary, others). Items move onto the primary order, each secondary order's KOTs are repointed at it -- KOT.restaurant_table is left alone so the kitchen still knows where every dish belongs -- and the emptied orders are deleted, which releases their tables through the existing on_trash hook. Merging therefore belongs at billing time, and the dialog says so. Guards reject anything that would produce a wrong or unpayable bill: submitted or already printed orders, aggregator orders, and mismatched customer, branch, POS profile, company or price list. Three read-only fields record what the bill is made of, so the printed bill can name every table the guests used rather than whichever one the surviving order happened to sit on: custom_is_merged, custom_merged_tables, custom_merged_invoices They accumulate, so merging a further table onto an already merged bill appends. Also lock editing once the bill is printed. The edit button ignored invoice_printed, while the server only rejected item removals -- so a printed order could still gain items. The button now honours the existing POS Profile field "Allow Cashier To Edit And Remove Table Order Items", which is what that setting always claimed to do. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
POS: default customer, table switch, edit lock after print, and order merging
Adds a waiter picker to the cart, below the customer selector, so the server can tag the employee who took the order. The selection is stored on POS Invoice.waiter and flows through to both the KOT and the bill. - get_waiters API returns active Employees for the picker - WaiterSelect: a combobox mirroring CustomerSelect, lists all employees and filters as you type; selected waiter shows in a chip with Change - OrderPanel sends the tagged waiter through the existing sync_order waiter param (falls back to the logged-in user when none is picked) - pos-store keeps selectedWaiter, restored when editing an order - URY KOT userSetting now prints the order's waiter instead of always the KOT creator, resolving a user id to its full name when needed Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two POS enhancements layered on the waiter-tagging feature. Waiter picker as an avatar grid: - A single search box opens a grid of employee avatars (photo + name), so a server can tap a face instead of reading a text dropdown. - The order details panel shows the tagged waiter's avatar beside the name. - get_waiters returns each employee's image, falling back to the linked User's user_image when the Employee has none. - WaiterAvatar: shared round avatar (image, or initials fallback). Item code on the item grid (opt-in via POS Profile): - New "Show Item Code In URY Pos" custom field, shipped as a fixture so it auto-installs on migrate like the existing show_image field. - When enabled, each card leads with the item code (bold) and drops the name to a lighter secondary line; off/absent keeps the name primary. - getRestaurantMenu returns item_code from the Item doctype; the flag and code are plumbed through menu-api, pos-store and pos-profile types. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat(pos): waiter avatar picker + item code on the item grid
feat(pos): tag an employee as the order's waiter (KOT + bill)
The 'sync fixtures from live DB' commit regenerated custom_field.json from a site that lacked the order-merge feature, removing custom_is_merged / custom_merged_tables / custom_merged_invoices. getPosInvoice still SELECTs these columns, so /pos/orders 500s on any fresh migrate. Re-add the three POS Invoice custom fields so migrate recreates the columns. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Header logo and browser-tab favicon now come from Website Settings (app_logo / favicon), falling back to the bundled URY logo when unset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Includes the Website Settings logo/favicon change. Committed (force-added past .gitignore) so the app updates on 'git pull' without a server-side yarn build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ge-fields feat(pos): Website Settings logo/favicon + restore order-merge custom fields
Step-by-step deploy guide for the chefworks.storenxt.in bench: pull into the live apps/ury folder, install/build/migrate, watch for skipped fixture syncs, and verify custom fields at the DB level. Captures the gotchas that caused a recent deploy to run against stale code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
docs: add URY POS deployment runbook
…sync Commit e7b28e9 ("sync fixtures from live DB") re-exported fixtures from a site that did not have the show_item_code field, silently dropping it from custom_field.json. The POS frontend and pos-profile API still read this field, so fresh installs / migrated sites lose the 'Show Item Code In URY Pos' toggle on POS Profile. Restores the field definition exactly as introduced in e7309d9 (feat(pos): waiter avatar picker + item code on the item grid). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… fixes Restaurant-floor fixes and features from Chefworks rollout: KOT - New kot_number field on URY KOT: sequential ticket number, resets daily when POS Profile 'Reset Order Number Daily' is enabled; doc name stays the internal unique series - Blank custom_kot_naming_series no longer blocks KOT creation (defaults to KOT-); same default in cancel and validation paths - multi_print_kot prints each physical printer once, fixing duplicate take-away KOTs when the same printer is on POS Profile and Production Unit Tables / billing flow - Printing the bill no longer frees the table; it stays occupied until the invoice is settled (released in a new POS Invoice on_submit hook) - Table card shows a single Payment action once the bill is printed (new getTableInvoiceStatus API); reprint taps go to payment instead of printing duplicate bills; PaymentDialog opens from the Table page - get_order_invoice falls back to the printed-but-unsettled invoice so printed tables still resolve their order URY Waiter role - New role shipped as fixture with Custom DocPerm fixtures (POS Invoice read/write/create without submit) and permission blocks on URY doctypes; removed on uninstall - Waiters use the POS but cannot bill: Orders section hidden, payment actions gated (canUserBill), make_invoice enforces server-side; Administrator / System Manager exempt - URY workspace visible to the role POS UI - Waiter is mandatory: submitting without one opens a picker dialog; the order is placed only on explicit confirm - Item code shown in cart and menu card (show_item_code), and used as the image placeholder instead of name initials; long codes truncate instead of breaking the layout Includes the built POS bundle for pull-only deploys. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat(pos): waiter role, payment-gated tables, KOT numbering and print fixes
…d fields Section 5 told operators to run 'bench export-fixtures --app ury' on the live bench every time a Custom Field was added via Desk. That rewrite of the fixtures file silently deletes any field the site hasn't migrated yet (cause of e7b28e9 losing show_item_code) and, left uncommitted, blocks every subsequent git pull on the server. Prefer recreating the field in code on a dev bench via PR; if exporting on the server, review the diff for deletions and never leave it uncommitted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PR #6 updated pos.html to reference the new hashed bundle (index-BsXCFILw.js / index-DDr-Nim_.css) but the asset files themselves were never committed: ury/public/pos is in .gitignore, so the freshly built untracked files were silently skipped by git add while the already-tracked pos.html went through. Result: white screen, 404 on /assets/ury/pos/assets/* on any site pulling develop. Rebuilt from pos/ source (yarn build) — hashes match what pos.html expects — and force-added the output. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ails docs: warn that export-fixtures on the live server destroys unmigrate…
chore(pos): commit missing built bundle assets for pull-only deploy
Fixture records without a "name" key crash sync_fixtures during
bench migrate (KeyError: 'name' in import_file_by_path) before any
later fixture file is imported. Use deterministic
{parent}-{role}-{permlevel} names so the import is idempotent.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…er KOT slips
- POS Profile "Fail Order When Printer Offline" (custom_block_on_print_failure):
print_via_cups submits the CUPS job and polls IPP job-state (8s); on timeout
the job is cancelled + purged (no ghost print on power-up) and the order
sync rolls back with a clear error. check_printer_ready fast-fails (~3s)
when the print node itself is unreachable, before any slip prints.
- network_printing rewritten on the same helper; string contract ("Success" /
"Failed to print: ...") kept for the Vue urypos callers, invoice_printed
only set on success. React invoice-api now checks the result instead of
toasting success unconditionally.
- multi_print_kot: collect -> pre-check -> print; dedupe key is now
(printer, format) so one physical printer can print Kitchen + Billing
slips with different formats; bare except swallowing print errors replaced
with Error Log (non-strict) / raise (strict).
- reprint_kot propagates real errors instead of logging and returning Success.
- Table page Print now opens a KOT / Bill chooser (PrintChoiceDialog) when
Enable KOT Reprint is on; KOT prints the full order (codes + qty) on the
billing-area printer via the existing table/parcel order printer config.
- MenuCard: no-image tile #0000A0 with bold white item code; card dark text
#333333.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Table-page print flow now respects canUserBill: billing roles get the KOT/Bill chooser, waiters go straight to the full-order KOT (button labelled "KOT") and never see the Bill option. Without KOT reprint enabled the Print button is hidden for non-billing users entirely. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Feat/thermal printing v2
Aborts before touching anything when the server tree is dirty (the export-fixtures drift that has broken the last two deploys), pulls ff-only, builds, migrates with maintenance mode guaranteed to come back off, and fails loudly when fixture sync is skipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Section 5 previously instructed running bench export-fixtures on the live bench; that command caused both broken deploys (lost fields, dirty tree blocking git pull). Replaced with the local-first workflow and pointed the runbook at scripts/deploy.sh. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The tracked www/pos.html and public/pos/index.html shells reference hashed bundle files that were gitignored, so a pull-only server got a blank /pos page with asset 404s (the server does not run yarn build; bench build does not build this SPA). Track ury/public/pos again so the shells and their assets always deploy together, as f197c8b originally intended. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts: # DEPLOYMENT.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Chore/deploy script
POS cart: - Offer only Dine In and Take Away. ORDER_TYPES keeps the full list and a new VISIBLE_ORDER_TYPES controls what the picker shows, so re-enabling Delivery / Phone In / Aggregators is a one-line change. An order already placed as a hidden type still shows its own chip when reopened. - Put the customer and waiter pickers side by side in one row and shrink both chips to a single 3rem line. Stacked full-width cards were eating most of the panel before the cart started. The dropdowns stay wide and anchor to the panel edge so the waiter avatar grid still fits. Table page: - Move the Available / Occupied legend into the column flow. As a fixed overlay it covered the last row of table cards, which the grid could never scroll past. Legend swatches now match the card colours (emerald / amber) instead of green / red. Payment dialog (used by both the Table and Orders pages): - Modes are now selectable. One is ticked by default (Cash when the profile offers it) and carries the whole bill, so a single-mode sale still needs no typing. - The balancing mode absorbs whatever is left: untick Cash after ticking UPI and the full amount moves to UPI; type 40 into UPI and Cash drops to the remainder. Typing into the balancing field pins that amount and hands the balancing role to the most recently ticked mode. - Clearing the balancing field is a no-op so the bill is never left uncovered, and the amount recomputes when a discount is applied. - Selections are reconciled against the profile's real payment modes, which arrive after the store's initial Cash placeholder. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.