Fix missing discount strikethrough on primary lines in Charges & Payments

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)

  1. Create a work order with 1 primary service + 1 ancillary/add-on.
  2. Apply a discount code intended to affect both lines (e.g. L10).
  3. Save/book the job.
  4. Open the workorder → Charges & PaymentsCost column.
  5. Expected: both lines show strikethrough original + discounted amount when a real discount applies.
  6. 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

  1. Problem type — Incorrect discount presentation on charge lines when a real promotion applies; do not change discount math or charge totals.
  2. 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.
  3. Primary surface — Fix Charges & Payments on the workorder (ServicesPayments.tsx Cost column). This is the confirmed repro surface.
  4. Invoice PDFOut of scope; current Invoice PDF discount display is acceptable and does not need changes for this work.
  5. Separation from ATT-1890ATT-1890 addresses false-positive discount styling; this work addresses missing strikethrough where discounts are legitimate.
  6. 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.tsoriginalBasePrice, 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

Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
🏠

Main App

Date

About 7 hours ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.