====== #151 — A contact-originated Sale invoice can never be voided or refunded through any reachable path (Resolved) ====== [[wiki:manara:bugs|← Back to Manara Bugs]] · [[https://mantis.matrixdn.net/view.php?id=151|View issue #151 in MantisBT]] ---- **Reported by:** Khaled Tarabay on 2026-07-30T14:27:53+01:00\\ **Assigned to:** Claude\\ **Resolved by:** Claude on 2026-08-01T07:26:09+01:00\\ **Severity:** major\\ **Priority:** immediate\\ **Reproducibility:** always\\ **Category:** General **Description:** The task's premise — that a Sale against a Client "creates a normal Draft sale invoice through the existing Billing engine" and should therefore be voidable and refundable like any ordinary customer invoice — does not hold. The exact same "manage it from the contact's page" guard that blocks editing a Purchase Bill (documented in BUG-PB04) also blocks the dedicated /void route and the Refunds & Credits flow for a Sale-kind contact invoice, even after it has been fully Issued, Collected, and a real Payments-module row exists for it. Recorded a real $300.00 Sale on Client-only contact 71 (DH Void 760899), producing Sale invoice LG-INV-169 (id 251). Issued it and collected the full $300.00 through the real contact-ledger "Collect" form — the invoice correctly reached Status: Paid, PAID $300.00, BALANCE DUE $0.00, and (unlike a Purchase Bill) a real row for it appeared in the global /payments list, confirming this is genuinely, unambiguously collected money, not a mirrored display figure. Tried every path a staff member or an attacker could reach to correct or reverse this invoice: GET /billing/251/edit — 302s straight to /contacts/71, identical to the Purchase Bill behavior already documented in BUG-PB04. No invoice_status_id select is ever rendered for this invoice. The invoice detail page itself never renders a "Void Invoice" button for this invoice at all (diffed the full button/link list against a control invoice, which does have one) — the control isn't merely disabled, it's absent. The ledger row's own "Settle" cell only ever offers "Issue" (pre-collection) or "Collect" (post-issue) — never a cancel/void action. Raw-POST bypass straight to the invoice's own dedicated void route, POST /billing/251/void — the real route a normal invoice's "Void Invoice" button submits to — returned 302 to /contacts/71 and left the invoice completely unchanged (Status: Paid throughout). A control probe against the identical route on a genuine non-contact Issued invoice (id 239) succeeded outright and flipped it to Status: Void, confirming the route itself works and the block is specific to contact-originated invoices. /credit-notes/create?invoice_id=251 reproduces BUG-PB01's misleading banner, but now against a Sale invoice with real collected cash rather than a Purchase Bill's mirrored figure: it displays "Linked to invoice LG-INV-169 - DH Void 760899 - Internet Service." at the top, while the invoice_id