Glossary
Quotation — a treatment cost estimate built for a patient before treatment happens, listing selected procedures with pricing, discount, insurance, and tax. Can later be converted into an Invoice. Model: Quotation in packages/prisma/schema.prisma.
Line item — this PR's term (in code, lineItems) for a single procedure's row within a quotation being edited, carrying its own discount, insurance, tax, and total, instead of one flat number for the whole quotation. See Per-Procedure Line Items.
Patient tax percent (patientTaxPercent) — the tax rate applied to the portion of a procedure's cost the patient pays out of pocket. Defaults to the patient's own tax field if set, otherwise the clinic's company-wide default tax rate.
Insurance tax percent (insuranceTaxPercent) — the tax rate applied to the portion of a procedure's cost the patient's insurance company covers. Defaults to the insurance company's own taxPercent field (InsuranceCompany.taxPercent), falling back to the patient tax rate if the insurance company doesn't have one set.
operationInsurance — a JSON string stored on the Quotation record holding an array of per-operation objects (discount, insurance, tax, notes, order, etc.) — the persisted form of the editor's in-memory lineItems. The field name discount inside this JSON is a legacy holdover meaning "insurance amount"; the actual price discount is stored separately as priceDiscount.
taxApplied — a per-procedure boolean (on the underlying Operation, overridable per quotation line) controlling whether tax applies to that procedure at all.
allowMaxLimit — a Saudi Arabia-specific per-line flag controlling whether a procedure counts toward an insurance policy's maximum coverage limit (maxLimit).
Policy class (policyClass) — an optional, more structured insurance configuration a patient can be assigned to (with its own maxLimit, insuranceLimit, insuranceUnlimited, insurancePercentage), read alongside the plain patient-level insurance fields.
handleUpdateQuotations — the server-side function (packages/server/src/resolvers/mutations/mutationUtils/quotationUtils.js) that recalculates a quotation's totals from its underlying operations whenever those operations change outside of a direct quotation edit (e.g. invoice conversion, chart edits).
pendingPaymentPercent — a GraphQL argument added to createNewQuotation/editQuotation in this PR, used server-side to compute pendingPayment. Currently unused by either client app's UI, so it always falls back to 100 in practice today.
Quotation Design — the branch-level print-settings dropdown (Settings → Print → Invoice Form) that selects between the legacy quotation print layout and the new itemized one added by this PR.
NewQuotationDesign — the new print-layout React component (packages/clinic-web/src/components/dashboard/settings/Print/NewQuotationDesign.js) rendered when a branch's Quotation Design is set to "New."