Incentive: Schalter "Abos beruecksichtigen", Recruiting Challenge ohne Abos

Die Recruiting Challenge erfasste Eigen- und Kundenabos mit 0 Punkten
(Live-Kopie: 175 Eigenabos). Sie tauchten in Details und Admin auf und
brachten Berater ohne Neupartner in die Rangliste.

- incentives.include_abos (Standard an); Migration schaltet Incentives
  ohne jede Abo-Wertung aus (0 Abo-Punkte, 0 Mindestabos, ohne Umsatzpunkte)
- aus: kein Abo-Tracking in Tracker, Neuaufbau und Reparatur;
  incentive:calculate raeumt vorhandene Abo-Zeilen ab
- Admin: Checkbox im Formular, Abo-Punkte/Mindestabos werden dann auf 0
  gesetzt; Abo-Spalte und -Bereiche in Admin, Details und Teilnahme-Hinweis
  entfallen
- Seeder der Recruiting Challenge setzt den Schalter aus

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kevin 2026-09-24 11:37:32 +00:00
parent 773d523bf7
commit 11afdb11d1
19 changed files with 306 additions and 34 deletions

View file

@ -59,6 +59,7 @@ class IncentiveController extends Controller
'bonus_rank_2' => 'nullable|numeric|min:0|max:999999',
'bonus_rank_3' => 'nullable|numeric|min:0|max:999999',
'include_sales_points' => 'nullable|boolean',
'include_abos' => 'nullable|boolean',
'vip_only' => 'nullable|boolean',
'status' => 'required|integer|in:0,1,2',
]);
@ -112,7 +113,9 @@ class IncentiveController extends Controller
}
/**
* Leere Betragsfelder als NULL speichern, Checkbox als bool.
* Leere Betragsfelder als NULL speichern, Checkboxen als bool. Ohne Abos werden
* Abo-Einmalpunkte und Mindestabos auf 0 gesetzt, sonst waere die Qualifikation
* unerreichbar.
*
* @param array<string, mixed> $data
* @return array<string, mixed>
@ -124,6 +127,11 @@ class IncentiveController extends Controller
}
$data['include_sales_points'] = filter_var($data['include_sales_points'] ?? false, FILTER_VALIDATE_BOOLEAN);
$data['vip_only'] = filter_var($data['vip_only'] ?? false, FILTER_VALIDATE_BOOLEAN);
$data['include_abos'] = filter_var($data['include_abos'] ?? false, FILTER_VALIDATE_BOOLEAN);
if (! $data['include_abos']) {
$data['points_abo_onetime'] = 0;
$data['min_customer_abos'] = 0;
}
return $data;
}
@ -159,6 +167,7 @@ class IncentiveController extends Controller
'bonus_rank_2' => 'nullable|numeric|min:0|max:999999',
'bonus_rank_3' => 'nullable|numeric|min:0|max:999999',
'include_sales_points' => 'nullable|boolean',
'include_abos' => 'nullable|boolean',
'vip_only' => 'nullable|boolean',
'status' => 'required|integer|in:0,1,2',
]);

View file

@ -51,7 +51,7 @@ class IncentiveController extends Controller
->paginate(100);
$participateHasTrackableAbos = false;
if (! $participant?->accepted_terms_at) {
if (! $participant?->accepted_terms_at && $incentive->includesAbos()) {
$participateHasTrackableAbos = $this->userHasTrackableAbosForIncentive($user, $incentive);
}