Order ledger
A React block (a whole screen) in Beamline's Shop app.
Purchase orders as money. Each order's spend is drawn against its approved total (paid, billed, pending, what is left, and any overrun past the end, named in words), with the invoices and card spend behind it. The order itself keeps purchaser, supplier and delivery place, lines with units and prices and whether each needs a receipt, internal files apart from those sent to the supplier, and approval, sending, delivery and billing as separate states; a supplier still waiting for approval holds the order. Auto-close says when an order closes if nothing new comes in, lets one order be left out, and a closed order be reopened (a refusal said). New orders are made from approved request lines, one supplier and one budget per order, quantities up to what remains, each line keeping the request it came from.
Use it for
- Following what was approved against what was billed and paid: purchase orders, contracts with a ceiling, project budgets, blanket orders.
- Turning approved requests into orders without mixing suppliers or budgets.
Not for
- Receiving deliveries into stock (purchase-orders).
- A single request's approvals (purchase-request).
- Invoices you send to customers (invoices).
Anatomy
- header: the product's mark, the title, Auto-close (a popover: on, days), New order from requests
- orders (nav): vendor, approved total, a slim bar of billed against it, number, status and billing in words
- order head: number and vendor, the period or start, the approved total, status and billing
- auto-close line: when it closes if nothing new comes in, Leave out (or Include); closed: why and when, Reopen
- Spend: usage-meter (paid, billed not paid, pending against the approved total, left or over), the overrun named, invoices and card spend with kind, reference, date, status and amount
- Order: a supplier waiting for approval said first; purchaser, supplier, deliver to, approval, sent, delivery, billing; lines with receipt or service and the request they came from; internal files and files sent to the supplier apart
- Activity: dated entries, newest first
- from requests (sheet): request lines by location under their source request (requester, date, budget); checkbox and quantity; a line from another supplier or budget said and not choosable; Create order with line count and amount
States
- unbilled, partly billed, fully billed, overbilled, closed, ended, archived, spend not known
- auto-close: off, scheduled, left out, closed, reopened, reopen refused
- order: draft, waiting for approval, approved not sent, sent; supplier not approved; delivery none, partial, received, services
- from requests: nothing chosen, chosen with quantities, another supplier or budget refused, creating, not created
- loading: shaped skeletons; no orders
- phone: the list, then the order with Back
- right to left: bars fill from the right; arrows mirror
- reduced motion: through the tokens
Keyboard
- Tab through the list, the order's actions and its views; arrows move between the views
- In the sheet: Tab through the lines' boxes and quantities; Escape closes
Motion
The usage meter and the sheet use their own parts' motion. Nothing runs at rest.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
orders | LedgerOrder[] | — | |
defaultOrders | LedgerOrder[] | — | |
onOrdersChange | ((orders: LedgerOrder[]) => void) | — | |
open | string | — | Controlled open state; omit to use defaultOpen. |
defaultOpen | string | — | Initial open state when uncontrolled; defaults to false. |
onOpenChange | ((id: string) => void) | — | Reports an open-state change; no callback by default. |
requestLines | RequestLine[] | — | Request lines that can become an order. |
onCreateFromRequests | ((picks: { lineId: string; quantity: number; }[]) => Promise<LedgerOrder>) | — | Make an order from chosen request lines; resolve with it. Reject: kept as chosen, the reason said. |
onAction | ((orderId: string, action: OrderAction) => Promise<LedgerOrder>) | — | Exclude from auto-close, include again, or reopen; resolve with the order as your app has it. |
policy | AutoClosePolicy | — | |
onPolicyChange | ((p: AutoClosePolicy) => Promise<unknown>) | — | |
today | string | — | Today in the company's calendar. |
currency | string | — | |
loading | boolean | — | |
product | string | — | |
className | string | — | Classes on the documented visual root; no override by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented native target or imperative handle; omitted by default. |
Built from
- Alert
- Avatar
- Bottom sheet
- Button
- Checkbox
- Empty state
- Label
- Number field
- Popover
- Segmented control
- Select
- Sheet
- Skeleton
- Slot text
- Spinner
- Switch
- Text morph
- Tooltip
- Usage meter
Dependencies
lucide-react
Import
import { OrderLedger } from "@beamline/order-ledger";
Get it
Order ledger is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in Shop
- Product editor: A product being made in a shop's back office, every value read as text at rest. The variant grid, grouped by the first option, lists each combination…
- Category manager: A shop's product categories, nested and ranked. Each category moves up, down or into another from its menu, and every move gets its own receipt (saving…
- Inventory item: One stock item in a shop's back office, apart from the variants that sell it (how many each uses per unit). Stock per location as stocked, reserved and…
- Plan comparison: Plans side by side against every feature: prices that roll between monthly and yearly, the current and recommended plan marked, a header that stays in…
- Step form: The finished frame for any multi-step form you compose — onboarding, intake brief, questionnaire, booking, application: a wide card with progress, the…
- Orders admin: A shop's order desk: today's orders and revenue, quick filters for what needs doing (to fulfil, unpaid, returns), a virtualised orders grid, and the…
- Order detail: One shop order with payment and fulfilment as two separate lanes. The header says where each stands (paid, partly paid, awaiting, refunded; not…
- Order board: A shop's orders as cards in its columns, on the shared kanban with drag and keyboard moves. Each card: number, estimate or work order, customer, vehicle…
- Order composer: An order made inside a support ticket: products found by name, each variant with its stock drawn and said (in stock, none, oversold, not known) and the…
- Draft orders: A draft order made for a customer in a shop's back office that reads like the order it will become. The lines lead: each with its variant and SKU or…
- Order changes: What happens to a shop order after it's placed. Edit: the order as it stands beside the requested version, each line marked new, changed (old → new…
- Special orders: Customers' special orders as demand to buy for, per outlet: To order apart from Ordered; each product's demand, what is reserved, incoming and on order…
- Order history and fills: Every order the account placed and every fill it got, for a period: totals for volume, fees, fill rate and maker share; orders with their status and how…
- Ticket orders: A customer's orders inside a support ticket, each action's effect said before it's done: orders and drafts kept apart, a paid draft shown once as its…
- Record search: One search across connected records (customers, vehicles, orders) by name, phone, plate, VIN or order number. What the words look like is said (info)…
- Return queue: A queue of return cases. Search by return, order or customer, exactly (the default) or loosely; status tabs with counts, Requires attention first; a date…
- Return case: One return as one place where every act is its own. The return, its order (linked out) and the customer on three cards; the stage said on its tone. Items…
- Return request: Staff start a return from an order, and edit the reasons customers pick. New return: the order's lines as a checklist, each with its variant, price and…
- Purchase orders: A salon's purchase orders, received: the orders down the side, the chosen one beside them. Each line still due reads as a strip of received, this…
- Print quote: A print shop's quoting in three places. Quote: a group of garments that share one imprint and one quantity break, the group's pieces counted together and…
- Service estimate: An estimate for one vehicle. Services added from the catalogue (one not listed for this vehicle said on warning, fit unknown said); each with its lines…
- Job card: A technician's repair order, phone-first. The vehicle, the customer and when it's due in words (due at, due in, overdue by how long); an offline copy…
- Parts tracker: Parts across a shop's work orders: each with its number, the order and vehicle, supplier, quantity and cost (not known said), and where it is: ordered…
- Visit board: The staff board for a walk-in queue: visits move from waiting through called and serving to done today. Arrival (here or on the way), the place in the…