CluPilotCloud/app/Services/Billing
nexxo d21e4f0eb2
tests / pest (push) Failing after 8m5s Details
tests / assets (push) Successful in 21s Details
tests / release (push) Has been skipped Details
Put a discount on the line it belongs to, so the columns add up
With one discount applied under the table, the gross column summed to 315,60
against a total of 284,04. Nothing was miscalculated — the discount simply came
after — but a reader who adds up a column found a document that does not agree
with itself, and no way to tell which figure was the real one. On an invoice
that is not a presentation detail.

A discount or surcharge now sits on its line, percentage or fixed amount, and
is inside that line's total. The label under the line is built from the same
value that did the arithmetic, so the words cannot end up describing a
different number than the one printed beside them.

The invoice-wide adjustment stays in the arithmetic for anything that genuinely
applies to the whole document, but nothing uses it by default.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 01:52:16 +02:00
..
AddonCatalogue.php feat(billing): a proof register, and modules frozen at their booked price 2026-07-26 13:07:34 +02:00
DowngradeCheck.php Measure availability, and let a customer move down again 2026-07-27 16:41:15 +02:00
InvoiceDocument.php Render an invoice, with the arithmetic held to integer cents 2026-07-29 01:41:46 +02:00
InvoiceMath.php Put a discount on the line it belongs to, so the columns add up 2026-07-29 01:52:16 +02:00
InvoiceNumbers.php Lay the foundation for self-issued invoices: series, numbers, frozen documents 2026-07-29 00:57:06 +02:00
InvoiceRenderer.php Render an invoice, with the arithmetic held to integer cents 2026-07-29 01:41:46 +02:00
PlanCatalogue.php feat(admin): a console for creating, pricing and scheduling plans 2026-07-26 12:41:51 +02:00
PlanChange.php feat(billing): Stripe owns the billing cycle, we own capability 2026-07-26 13:36:28 +02:00
SampleInvoice.php Put a discount on the line it belongs to, so the columns add up 2026-07-29 01:52:16 +02:00
TaxTreatment.php fix(billing): verification vouches for a value, not for a row 2026-07-26 09:34:40 +02:00