mivita/resources/views/user/incentive/details.blade.php
Kevin b28f51bf62 Incentive (E1): Recruiting-Challenge mit Geldpraemie, Auszahlungs-Export und parallelen Incentives
Neue Felder amount_per_partner, bonus_rank_1..3 und include_sales_points an
incentives. Mit ausgeschalteten Umsatzpunkten zaehlt die Wertung nur die
Einmalpunkte je Neupartner, die Rangliste entspricht damit der Anzahl
Neupartner mit Starterpaket. IncentivePayoutService rechnet Neupartner mal
Betrag plus Rang-Bonus fuer qualifizierte Gewinner; Admin-Detailseite bekommt
Praemienspalte, Summen und XLSX-Export fuer die Auszahlung.

Sidenav und Dashboard zeigen alle aktiven Incentives, damit Montenegro und
die Challenge parallel laufen koennen. Teaser, Rangliste und Details zeigen
bei Geldpraemie die Praemien-Kachel und "Deine Praemie bisher" und blenden
Abo-Bloecke aus, wenn Abos keine Rolle spielen. Montenegro bleibt unveraendert.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 12:10:27 +00:00

115 lines
5.3 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_show', [$incentive->slug]) }}" 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>
@else
<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->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