Skip to content

Screens

A packaging quote that works out its price as you type

The quote form keeps the brief on the left (customer, product, size, material and sheet, runs, print and finishing) and the price on the right, worked out again on every keystroke. Up to three runs sit side by side with the price per piece, the total and the margin, and the run picked under them shows where its price goes: paper, printing, die cutting and tool, overhead and margin. A margin under 18% is marked at once, and somebody other than the author has to approve it before the quote goes out.

By Bohuslav PoláčekChecked

Foldline's quote QUO-2026-0321 open for editing, rendered from the kit when the site was built with the demo's data on 2 December 2026. The window is cut before the layout on the sheet, which the demo draws itself; on a phone the calculation follows the fields and the footer keeps the price.

Open it in the live demo An app for a packaging and print company

The brief and the price side by side

The page is a Screen with the form archetype, and the calculation is its summary with summaryWidth="wide": a working result people read while they type, 32rem beside the fields from 1280px and sticky in the screen's one scroll, so the price never leaves the screen while the brief changes. The fields sit in Sections, each in a Field with a visible label, and a hint says what a choice decides: "The format decides the press: B1 and B2 go to offset, SRA3 to digital, big sheets to flexo."

A half-filled brief does not show a wrong price. The column says "The price cannot be worked out yet." and lists what stops it, for example a size that does not fit the sheet.

Where the price comes from

  • Price by run: up to three runs in a plain table (run, per piece, total, margin). The price per piece falls with the run; in the window it roughly halves from 500 to 2,000 pieces.
  • Details for: one choice of run for everything under it, a SegmentedControl.
  • Where the price goes: a BarList of paper, printing, die cutting and tool, overhead and margin, each with its share, then the total excluding VAT.
  • Further down: the layout on the sheet ("2 places (2 × 1), 46% of the sheet used."), the sheets and the waste, the time on each machine. When another sheet of the same material makes the first run at least 3% cheaper, a tip offers it with Use this sheet.

A margin floor with four eyes

A generated quote form usually has a Calculate button, or stores the price when the quote is saved, and from then on the record and the list can drift from the brief. Here the form, the record and the list all call one pure calculate() on the brief, and the rule for low margins (the code above) reads its result.

Under 18% the margin cell turns to the warning colour and a note under the table says what follows: "somebody other than the author has to approve it before it is sent (production manager, approver or admin)." The permission quotes.approve refuses the author's own quote, as every approval flow in the kit does.

Rules of the form

  • Validation: react-hook-form with zod, and messages that say what to do.
  • Unsaved changes: leaving the form asks first (useBlocker with a confirm).
  • Only a draft is edited: the edit address of a quote that went out opens its record instead, and only the author or the production manager, approver or admin edits it.
  • Who reads quotes: sales and customer care write them, prepress and the press read them to see what is coming, and a customer never sees one, since a quote holds the shop's prices and margins.

On a phone the calculation follows the fields, and the sticky footer keeps the first run's price beside Save. See how Foldline counts the offers out with customers and the margins waiting for a yes over its job pipeline.

The margin floor, worked out each time

apps/demo/src/modules/quotes/domain/summary.ts
/** The margin is under the floor: sending needs another person's approval. */
export const underFloor = (marginPct: number | null) => marginPct !== null && marginPct < marginFloor * 100 - 1e-9;

/**
 * Where a quote stands on its margin:
 * ok (no approval needed), needs (under the floor, nobody asked yet), waiting (asked),
 * approved, refused (asked and turned down: change the price or ask again).
 */
export type MarginState = "ok" | "needs" | "waiting" | "approved" | "refused";

export function marginState(quote: Quote, marginPct: number | null): MarginState {
  if (!underFloor(marginPct)) return "ok";
  if (quote.status === "approval") return "waiting";
  if (quote.approval?.decision === "approved") return "approved";
  if (quote.approval?.decision === "rejected") return "refused";
  return "needs";
}

/** Convenience for the api: the summary of a quote's brief. */
export const summaryOf = (quote: Pick<Quote, "brief">) => summarize(calculate(quote.brief));
Whether a quote needs a second yes is derived from its brief by the same calculation the form shows, never stored, so a quote can never state a price its brief does not give.

Questions

Can the price be worked out before the form is complete?

Yes, as soon as the brief can be priced. Until then the price column says what stops it, for example a size that does not fit the sheet, instead of showing a number that is not true.

Who approves a margin under the floor?

The production manager, the order approver or the admin, and never the quote's author. Under 18% the quote waits for that approval before it can be sent.

Can a customer see the margin?

No. A customer signed in for their proofs has no right to quotes at all, because a quote holds the shop's prices and margins. Prepress and the press read quotes without changing them.

Why does the price per piece fall with the run?

Part of the cost is paid once per job, such as the cutting tool and the set-up, and a longer run shares it among more pieces. The breakdown under the table shows the parts for the run picked.

Two ways

Build it yourself, or have it built

  • Build it yourself

    Build your app on the framework

    Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.

    One payment, lifetime updates

    Get the framework
  • Have it built

    Have us build your app

    Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.

    After launch, Care keeps it improving, from €99 a month.

    from €1,990

    Describe your app