Abo: Bestellung extern als erledigt markieren (ohne Rechnung/Inkasso)

Neue Admin-Funktion fuer angehaltene Abo-Bestellungen, die der Kunde
ausserhalb des Systems geliefert und verrechnet hat.

Aktion (AboExternalCompletionService):
- Punkte gutschreiben wie bei eingegangener Zahlung (SalesPointsVolume,
  idempotent gegen Doppelbuchung)
- UserAboOrder auf neuen gruenen Status 8 "extern erledigt"; paid bleibt false
- Bestellung: shipped=2 (Lieferung bestaetigt), keine Rechnung/kein Lieferschein
- Blockade aufheben: Abo zurueck auf status=2 (okay), aktiv, next_date neu,
  damit der naechste Termin regulaer laeuft
- wie bei regulaerer Ausfuehrung: IncentiveTracker + AboOneTimeService-Purge

Einstiegspunkte: Button + Bestaetigungs-Modal auf der Kunden-Bestelldetailseite
(SalesController) und auf der Abo-Detailseite (Admin\AboController@externDone,
Route admin_abos_extern_done). Status 8 (gruen) in UserAbo/UserAboOrder, Labels
de/en.

Tests: tests/Feature/AboExternalCompletionTest (Happy Path, Idempotenz,
bezahlt-/Nicht-Abo-Guards, Abo-Detail-Einstieg) - 5 gruen.

Zusaetzlich: docs/2026-06-11-test-suite-vorbestehende-fehler.md - Diagnose der
93 vorbestehenden (von master geerbten) Test-Suite-Fehler.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Kevin 2026-06-11 15:40:16 +00:00
parent 8593dbe65d
commit 090debf1b4
13 changed files with 609 additions and 59 deletions

View file

@ -45,6 +45,7 @@ return [
'abo_finish' => 'finished',
'abo_inactive' => 'inactive',
'abo_grace' => 'grace',
'abo_extern_done' => 'externally completed',
'abo_info' => 'Subscription information',
'info_min_duration_reached' => 'Your subscription can be changed, supplemented, paused or canceled earliest from :date.',
'info_min_duration_orders_left' => 'The subscription can only be changed, supplemented, paused or canceled after another :count executions.',
@ -162,6 +163,16 @@ return [
'retry_success' => 'The payment retry was successful. Order #:order was created.',
'retry_failed' => 'The payment retry failed. Order #:order was created. Error: :error',
'retry_exception' => 'The payment retry could not be completed: :error',
'extern_done' => 'Externally completed',
'extern_done_confirm_title' => 'Mark order as externally completed',
'extern_done_confirm_copy' => 'The order will be marked as delivered and invoiced outside the system. NO invoice and NO delivery note will be created and the status stays unpaid. The subscription points will be credited and the subscription block will be lifted so it runs normally at the next date.',
'extern_done_confirm_button' => 'Mark as completed',
'extern_done_only_abo' => 'This action is only available for subscription orders.',
'extern_done_no_order' => 'No held subscription order was found that can be completed.',
'extern_done_already' => 'This order has already been marked as externally completed.',
'extern_done_already_paid' => 'This order is already paid and cannot be completed externally.',
'extern_done_success' => 'The order was marked as externally completed. Points credited, block lifted.',
'extern_done_error' => 'The order could not be marked as completed: :error',
'back' => 'back',
'team_subscriptions' => 'Team subscriptions',
'team_customer_abos' => 'Team Customer Subscriptions',