On this page
The decision in one paragraphWhy it mattersImpact and reachRisk assessmentWhat success looks likeWhat we are explicitly not claimingFor Stakeholders
The decision in one paragraph
A reporting figure on the invoices analytics bar — the discount percentage — was computed against the wrong base, making discounts look larger than they were. This change corrects the denominator so the figure reflects the true "percent off." It is a two‑line, display‑only fix on web and mobile, with no data migration and no behavioural change to invoicing.
Pre‑release. On branch mo/fix_invoice_discount_percent_in_table_analytics (PR #356), not yet in production.
Why it matters
- Trust in the numbers. Finance staff and owners use the discount tile to
judge how much margin they're giving away. An overstated percentage erodes confidence in the whole analytics surface. Correcting it protects the credibility of the financial module.
- Consistency with the ledger. The corrected base (
total + discount)
aligns the tile with how invoice totals are actually constructed (total = subtotal − discount + tax). It removes a discrepancy between what the dashboard says and how the books add up.
- Cross‑platform parity. Web and mobile are fixed identically, so a manager on
a phone and an accountant at a desk see the same figure.
Impact and reach
- Scope: one tile on one screen (Invoices), on two clients (web, mobile).
- Users affected: anyone who reads the invoices analytics bar — primarily
owners, managers, accountants.
- Direction of change: the displayed discount percentage goes down to its
correct value (e.g. 13.0 % → 11.5 % on the sandbox data set).
Risk assessment
Low risk.
- No database writes, no schema change, no migration.
- No change to how invoices, discounts, taxes, or payments are calculated or
stored.
- The change is a single arithmetic expression, guarded against divide‑by‑zero,
duplicated verbatim across the two clients.
One residual nuance to be aware of (not a defect, a definitional choice): the new denominator is tax‑inclusive (total + discount = subtotal + tax), whereas the per‑invoice stored discountPercent is pre‑tax (discount ÷ subtotal). For tax‑exempt invoices the two match exactly; for taxed invoices the tile reads marginally lower than the per‑invoice figure. If a single, consistent definition across both surfaces is desired, that's a small follow‑up decision — see For Quality.
What success looks like
- The discount tile matches a hand calculation of
discount ÷ (total + discount). - No support tickets about "impossible" or inflated discount percentages.
- No regressions in the other tiles or in invoice totals.
What we are explicitly not claiming
This is not a new feature, not a redesign, and not a fix to other financial reports. Positioning it as anything larger than "a correctness fix to one reported percentage" would overstate it.