amount—they adjust admin/commission math in modifierPriceCalc.ts. Misleading discount styling is driven by invoice display heuristics, not admin modifier evaluation itself.InvoicePDF.tsx and InvoiceAttachmentPDF.tsx, a charge line is treated as discounted when originalBasePrice > amount, or when any discount metadata is present (discountAmount, bundle/code discount fields, _discountCodeId). Matching lines render strikethrough, a bold final amount, and generic “Discount applied” when no bundle/code name is available.originalBasePrice > amount strikethrough appears on the workorder Charges & Payments table in ServicesPayments.tsx (comment in PDF code says to keep in sync).InvoiceDrawer.tsx (tools workorder and client portal); email attachments via backend buildTemplateEmailAttachments.ts using InvoiceAttachmentPDF.tsx.Locked
InvoicePDF.tsx and backend InvoiceAttachmentPDF.tsx must stay aligned; both are in scope.Open
originalBasePrice, amount, preTaxAmount, discountAmount, bundle/code IDs, modifier types on the service)? Needed to confirm whether the fix is display-only or also charge persistence.ServicesPayments.tsx), or PDF/email only in v1?originalBasePrice vs amount comparison — originalBasePrice is pre-tax starting fee; amount includes tax. Should invoice discount detection require explicit discount fields (bundle/code/discountAmount) rather than any case where stored base exceeds final amount?attik-frontend/src/components/invoice/InvoicePDF.tsx — getBaseOriginalTotal, per-line hasDiscount, strikethrough rendering, subtotal/savings section (showDiscountUI, totalSavings).attik-frontend/src/components/invoice/InvoiceDrawer.tsx — used from ServicesPayments.tsx (tools) and JobAccordion.tsx (client portal).attik-frontend/src/app/tools/inspections/[id]/components/ServicesPayments.tsx — originalBasePrice > charge.amount strikethrough; keep in sync with PDF per code comment.attik-backend/src/util/functions/pdf/templates/InvoiceAttachmentPDF.tsx — duplicate discount logic; must match frontend fix.attik-backend/src/util/functions/emailBuilder/buildTemplateEmailAttachments.ts — renders InvoiceAttachmentPDF for template emails.attik-backend/src/models/chargeSchema.ts — originalBasePrice, discountAmount, bundle/code discount fields, amount, preTaxAmount.attik-frontend/src/util/functions/quote/createChargeObjects.ts — sets originalBasePrice from startingFee, amount from totalPrice / priceOverride.attik-backend/src/util/functions/schedule/modifierPriceCalc.ts — addType: 'admin' affects finalAdminAddition only; addType: 'cost' affects customer finalPrice. Display bug is separate from admin modifier math unless charge fields are written incorrectly on save.attik-frontend/src/components/invoice/InvoicePDF.tsxattik-backend/src/util/functions/pdf/templates/InvoiceAttachmentPDF.tsxattik-frontend/src/app/tools/inspections/[id]/components/ServicesPayments.tsxattik-backend/src/util/functions/schedule/modifierPriceCalc.tsattik-frontend/src/util/functions/quote/createChargeObjects.tsPlease authenticate to join the conversation.
Planned
Main App
About 14 hours ago
Linear
Get notified by email when there are changes.
Planned
Main App
About 14 hours ago
Linear
Get notified by email when there are changes.