mivita/resources/views/user/incentive/details.blade.php
Kevin 11afdb11d1 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>
2026-09-24 11:37:32 +00:00

115 lines
5.4 KiB
PHP

@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
{{ $incentive->name }} - {{ __('incentive.my_calculation') }}
<a href="{{ route('user_incentive_teaser', [$incentive->slug]) }}#ranking" class="btn btn-sm btn-outline-primary float-right">
<span class="fa fa-arrow-left"></span> {{ __('incentive.back_to_ranking') }}
</a>
</h4>
{{-- Zusammenfassung --}}
<div class="row mb-4">
<div class="col-md-3">
<div class="card text-center">
<div class="card-body">
<h5 class="card-title text-muted">{{ __('incentive.total_points') }}</h5>
<h2 class="font-weight-bold">{{ number_format($participant->total_points, 0, ',', '.') }}</h2>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-center">
<div class="card-body">
<h5 class="card-title text-muted">{{ __('incentive.rank') }}</h5>
<h2 class="font-weight-bold">{{ $participant->rank ?? '-' }}</h2>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-center">
<div class="card-body">
<h5 class="card-title text-muted">{{ __('incentive.partners') }}</h5>
<h2 class="font-weight-bold {{ $participant->qualified_partners >= $incentive->min_direct_partners ? 'text-success' : '' }}">
{{ $participant->qualified_partners }}@if ($incentive->min_direct_partners > 0)/{{ $incentive->min_direct_partners }}@endif
</h2>
</div>
</div>
</div>
@if ($incentive->hasCashPayout() && !$incentive->usesAbos())
@php $detailPayout = (new \App\Services\Incentive\IncentivePayoutService)->forParticipant($incentive, $participant); @endphp
<div class="col-md-3">
<div class="card text-center" id="incentive-payout-card">
<div class="card-body">
<h5 class="card-title text-muted">{{ __('incentive.payout_so_far') }}</h5>
<h2 class="font-weight-bold">{{ \App\Services\Incentive\IncentivePayoutService::formatAmount($detailPayout['total']) }}</h2>
@if ($detailPayout['rank_bonus'] > 0)
<small class="text-muted">{{ __('incentive.payout_incl_bonus', ['amount' => \App\Services\Incentive\IncentivePayoutService::formatAmount($detailPayout['rank_bonus'])]) }}</small>
@endif
</div>
</div>
</div>
@elseif ($incentive->includesAbos())
<div class="col-md-3">
<div class="card text-center">
<div class="card-body">
<h5 class="card-title text-muted">{{ __('incentive.abos') }}</h5>
<h2 class="font-weight-bold {{ $participant->qualified_abos >= $incentive->min_customer_abos ? 'text-success' : '' }}">
{{ $participant->qualified_abos }}/{{ $incentive->min_customer_abos }}
</h2>
</div>
</div>
</div>
@endif
</div>
{{-- Sektion A: Neupartner-Punkte --}}
<div class="card mb-4">
<div class="card-header">
<strong>{{ __('incentive.section_partners') }}</strong>
</div>
<div class="card-body p-0">
@include('partials.incentive._source_table', [
'sources' => $partner_sources,
'type' => 'partner',
'label_header' => __('incentive.new_partner'),
'date_header' => __('incentive.entry_date'),
'empty_message' => __('incentive.no_partners_yet'),
])
</div>
</div>
{{-- Sektion B: Kundenabo-Punkte (entfaellt bei reiner Recruiting-Challenge) --}}
@if ($incentive->includesAbos() && ($incentive->usesAbos() || $abo_sources->isNotEmpty()))
<div class="card mb-4">
<div class="card-header">
<strong>{{ __('incentive.section_abos') }}</strong>
</div>
<div class="card-body p-0">
@include('partials.incentive._source_table', [
'sources' => $abo_sources,
'type' => 'abo',
'label_header' => __('incentive.customer_abo'),
'date_header' => __('incentive.abo_date'),
'empty_message' => __('incentive.no_abos_yet'),
])
</div>
</div>
@endif
{{-- Gesamtpunkte --}}
<div class="card border-primary">
<div class="card-body text-center">
<h4>{{ __('incentive.total_points') }}:
<strong>{{ number_format($participant->total_points, 0, ',', '.') }}</strong></h4>
@if ($participant->is_qualified)
<span class="badge badge-success badge-lg p-2">{{ __('incentive.qualified') }}</span>
@if ($participant->isWinner())
<span class="badge badge-warning badge-lg p-2">{{ __('incentive.winner') }}</span>
@endif
@else
<span class="badge badge-secondary badge-lg p-2">{{ __('incentive.not_yet_qualified') }}</span>
@endif
</div>
</div>
@endsection