Objective
- Show consistent discount strikethrough styling on every charge line in Charges & Payments where a real discount applies — especially when a discount code (e.g.
L10) affects both primary and ancillary services.
- Make staff-facing line-level pricing trustworthy: totals are already correct, but the primary service line must show the same crossed-out original + discounted presentation as ancillary lines when the discount applies equally to both.
Background
- Product feedback and user confirmation: when a discount code applies to both primary and ancillary services, pricing math is correct and the order total is right — but the primary line shows a flat amount with no strikethrough while the ancillary/add-on line shows discount styling.
- The only confirmed defect is missing strikethrough on the primary service line when a legitimate discount is equally applied; ancillary lines already display correctly in the repro case.
- Repro was confirmed on workorder → Charges & Payments → Cost column. An early report mentioned invoice PDF; Invoice PDF display is acceptable as-is and is not in scope for this fix.
- This is a visual/display bug, not a pricing-calculation bug. Track separately from ATT-1890 (false discount styling on repriced lines).
Confirmed repro (Charges & Payments)
- Create a work order with 1 primary service + 1 ancillary/add-on.
- Apply a discount code intended to affect both lines (e.g.
L10).
- Save/book the job.
- Open the workorder → Charges & Payments → Cost column.
- Expected: both lines show strikethrough original + discounted amount when a real discount applies.
- Actual: ancillary shows discount styling; primary does not, while order total remains correct.
Charge fields to compare on repro orders (primary vs ancillary)
originalBasePrice, amount, codeDiscountAmount, bundleDiscountAmount, discountAmount, _discountCodeId
Repro Video
Screen Recording 2026-06-16 at 9.21.38 AM.mov
Product Decisions
Locked
- Problem type — Incorrect discount presentation on charge lines when a real promotion applies; do not change discount math or charge totals.
- Confirmed symptom — Discount is equally applied to primary and ancillary charges; totals are correct; ancillary line shows strikethrough styling; primary line omits strikethrough — that inconsistency is the defect.
- Primary surface — Fix Charges & Payments on the workorder (
ServicesPayments.tsx Cost column). This is the confirmed repro surface.
- Invoice PDF — Out of scope; current Invoice PDF discount display is acceptable and does not need changes for this work.
- Separation from ATT-1890 — ATT-1890 addresses false-positive discount styling; this work addresses missing strikethrough where discounts are legitimate.
- Line consistency — When a discount applies to multiple services, each affected line should show equivalent discount styling (not only ancillary/add-on lines).
Scope
Frontend — workorder (in scope)
- Charges & Payments table:
attik-frontend/src/app/tools/inspections/[id]/components/ServicesPayments.tsx — Cost column currently shows strikethrough only when originalBasePrice > charge.amount. It does not consider codeDiscountAmount, bundleDiscountAmount, discountAmount, or _discountCodeId.
- Reference pattern (broader discount detection):
attik-frontend/src/components/ui/EditableInvoiceTable.tsx uses bundleDiscountAmount, codeDiscountAmount, primaryDiscountAmount, and getOriginalTotalForDiscountDisplay with optional usePrimaryFeeForBundleDiscount — useful comparison for how other surfaces detect a real discount.
- Charge shape:
attik-backend/src/models/chargeSchema.ts — originalBasePrice, discount fields, and amount on saved charges.
Out of scope
- Invoice PDF (
InvoicePDF.tsx), email attachment PDF (InvoiceAttachmentPDF.tsx), and invoice drawer — per product decision, PDF display is fine as-is.
- Changing discount calculation, code eligibility, or bundle pricing rules.
- ATT-1890 false-positive fixes — related but separate delivery.
References