Dentolize · Quotation Tax Fix & New Design Walkthrough
On this pageWhy this mattersRisk profileA regression worth a decision before this shipsImpact if this ships as-is

For Stakeholders

Why this matters

Quotations are the number a patient agrees to before treatment starts. If that number is wrong — specifically, if tax on the insurance-covered portion is computed at the wrong rate — the patient may be quoted an incorrect amount, and the eventual invoice may not match what they were told. That's a trust and billing-accuracy issue, not a cosmetic one. This PR fixes the root cause by bringing Quotations onto the same tax-calculation model Invoices already use, rather than patching symptoms.

Risk profile

  • Financial correctness: this changes how tax is calculated for any quotation involving insurance, which is a core money-handling path. The fix is modeled directly on the existing, already-in-production Invoice logic rather than a novel approach, which reduces (but doesn't eliminate) risk.
  • Backward compatibility: existing quotations get patientTaxPercent/insuranceTaxPercent defaulted to 0 via migration, and the recalculation logic treats 0 as "fall back to the original flat tax rate" — so historical quotations aren't silently recalculated with a new number until something triggers a recompute (e.g. converting to an invoice, editing chart operations).
  • Scope containment: the print-design addition is opt-in per branch and additive (old layout still available), so it carries much lower rollout risk than the tax-calculation change.

A regression worth a decision before this ships

Verified in the diff: the quotation drawer's "insurance remaining" figure used to be computed as patientDetails.insuranceLimit - totalInsuranceUsed (where totalInsuranceUsed came from patientDetails.dailyInsurancePaid). In this PR, totalInsuranceUsed was replaced with a hardcoded 0 on both web (QuotationDrawer.js:1319) and the equivalent mobile logic (insuranceLeftToUse, NewQuotationScreen.js:144), so the figure now always shows the patient's full policy limit regardless of insurance already used that day. This looks like an unintentional regression rather than a deliberate simplification — recommend confirming with engineering whether it should be restored before this ships, since it means the quotation screen can currently overstate how much insurance coverage a patient has left.

Impact if this ships as-is

  • Clinics with patients whose insurance company tax rate differs from the patient's own rate will see quotation totals shift (more accurately) compared to before — support should expect "why did the number change" questions (see For Support).
  • No visible change for clinics without insured patients, or where insurance-company and patient tax rates happen to match.
  • No forced UI change for anyone unless they opt into the new print design.
  • The insurance-remaining regression above affects every quotation for an insured patient, on both platforms, regardless of tax rates — it's a display issue, not a billing issue (invoices are unaffected), but it's worth resolving or explicitly accepting before wider rollout.