CluPilotCloud/app/Services/Billing
nexxo 6d7c2bdf35
tests / pest (push) Failing after 8m35s Details
tests / assets (push) Successful in 22s Details
tests / release (push) Has been skipped Details
Ask whether they are a consumer, and let one change their mind
Three things the product owed its customers and did not have.

**Who is on the other side.** There was no consumer/business flag anywhere,
and `vat_id` was standing in for one — which it cannot: a business without a
VAT number is an ordinary small business, and a consumer with one does not
exist. It is asked at sign-up now, correctable in the portal, and NULL where
nobody has been asked. Unknown is read as CONSUMER everywhere it decides a
right, because that mistake costs us a refund while the other one takes a
statutory right away from somebody who has it.

Reverse charge asks the recorded type instead of the number: an explicit
consumer is charged the domestic rate whatever `vat_id` says — previously they
were not, and anyone could zero their own VAT by getting a number verified. An
unrecorded type still falls back to the verified number, so no contract that is
already running changes rate.

**The fourteen-day right of withdrawal** (FAGG, §312g BGB), for consumers only,
at every door: the window is stamped on the contract when it is concluded, the
customer exercises it from the portal, an operator records one that arrived by
telephone or post, and both go through one action that refuses a business
customer on the server rather than by hiding a card.

The money follows the paperwork rather than being computed beside it. The
invoice is cancelled by a Storno with its own gapless number — nothing is ever
edited or deleted — a new invoice states the pro-rata value of the service
actually delivered (FAGG §16, by days over the term paid for), and the refund
is exactly the difference between the two documents. Where the consumer never
expressly asked for the service to begin at once, they owe nothing and the whole
amount goes back. `StripeClient::refund()` is new, keyed so a retry cannot send
the money twice. The service ends through EndInstanceService and the
`cancellation_scheduled` machinery that was already there.

**The cancel button for modules.** BookAddon::cancelAtPeriodEnd() had no caller
in the interface at all, so a customer could book a recurring charge in two
clicks and had no way to stop it. It is on the module card now, with the date it
runs until and a way back while the cancellation is still pending — and putting
a module back settles nothing, because the term it was cancelled for was paid
for in advance.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 21:06:06 +02:00
..
AddonCatalogue.php Ask whether they are a consumer, and let one change their mind 2026-07-29 21:06:06 +02:00
AddonPrices.php Bill a booked module every month, and put it on the invoice 2026-07-29 20:22:02 +02:00
CustomDomainAccess.php Serve the custom domain, not just announce it 2026-07-29 16:44:52 +02:00
DowngradeCheck.php Deliver the storage a customer actually buys 2026-07-29 19:13:10 +02:00
InvoiceArchive.php Leave the archive readable by whoever collects from it 2026-07-29 03:48:03 +02:00
InvoiceDocument.php Render an invoice, with the arithmetic held to integer cents 2026-07-29 01:41:46 +02:00
InvoiceMath.php Print every line at full price and take the discount off once, in euros 2026-07-29 01:59:56 +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
IssueInvoice.php Ask whether they are a consumer, and let one change their mind 2026-07-29 21:06:06 +02:00
PlanCatalogue.php Paketversionen: Verkauf wieder aufnehmen und saubere Übergabe 2026-07-29 14:58:11 +02:00
PlanChange.php Book a downgrade for a date that cannot move, and sell a module once 2026-07-29 17:51:37 +02:00
SampleInvoice.php Print every line at full price and take the discount off once, in euros 2026-07-29 01:59:56 +02:00
StorageAllowance.php Deliver the storage a customer actually buys 2026-07-29 19:13:10 +02:00
StripeInvoiceLines.php Bill a booked module every month, and put it on the invoice 2026-07-29 20:22:02 +02:00
TaxTreatment.php Ask whether they are a consumer, and let one change their mind 2026-07-29 21:06:06 +02:00
WithdrawalRight.php Ask whether they are a consumer, and let one change their mind 2026-07-29 21:06:06 +02:00