mivita/resources/views/admin/abo/_change_history.blade.php
Kevin ac3bd6e8ea Statistiken/Abo: Kundenfeedback 2026-07-24 komplett umgesetzt + Steuern: DATEV-Fixes 08+09/2025 (Sammel-Commit Branch-WIP)
Feedback-Umsetzung (dev/2026-07-22/feedback-analyse-2026-07-24.md, alle 10 Punkte):
- VIP-Statistik: eigener Berater ('ich', Linie 0) in Neue-Kundenabos- und beiden Top-10-Listen; Top-10-Umsatz sortiert nach abgerechneten Ist-Punkten + Abo-Anzahl-Spalte; Fußnote nicht-payline-wirksame Punkte (SalesVolumePoints::nonPaylinePoints)
- Führungskräfte-Liste: beide Sichten 'direkt' (an nächster FK abgeschnitten, additiv) und 'gesamt' (komplette Downline), Gesamt-Spalte nach Kundenzählweise
- Team-Abos: je Ebene 'abgerechnet (Monat)' und 'bis zum 25. erwartet'; Payline-Karte mit Teamabo-/Kundenabo-Zählern
- Incentive-Live-Ranking: Qualifizierte zuerst nummeriert (fixt auch isWinner rank<=max_winners)
- Porto: Netto-/Brutto-Kennzeichnung (Berater netto, Endkunden inkl. MwSt., portal_view-Flag; auch CRM-/Shop-Warenkorb + Checkout), Yard::shipping_tax-Fix
- Struktur-Ansicht: Abo-Badges 'A' (eigenes Abo) und '(n)' (Kundenabos) je Teampartner, gebatcht
- Abo-Löschung: Softdelete setzt active=0 (UserAbo deleting-Hook) + Bereinigungs-Migration für gelöschte-aber-aktive Abos
- Doku: technische Analyse + Kundinnen-Feedback-Dokument unter dev/2026-07-22/
- Tests: IncentiveRankingTest, TeamStructureAboBadgesTest, YardShippingTaxTest (neu); BackofficeStatisticsListsTest, TeamAboOverviewTest, PaylineForecastServiceTest, AboAdminDeleteTest, AboOneTimeViewTest erweitert

Außerdem enthalten (Branch-WIP vor dem Feedback): DATEV-Abgleich-Fixes 08+09/2025, USt-ID-Live-Validierung sowie restliche unkommittete Stände (u. a. Abo-Pause-Sprachkeys).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 13:56:02 +00:00

91 lines
4.3 KiB
PHP

@php
$changeHistory = $user_abo->getChangeHistory();
$statusHistory = $user_abo->status_histories()->with('actor.account')->orderByDesc('created_at')->orderByDesc('id')->get();
$priceLabel = $user_abo->is_for === 'me' ? __('abo_history.price_net') : __('abo_history.price_gross');
@endphp
<div class="card-body">
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="font-weight-semibold mb-0">
<i class="fas fa-history"></i> {{ __('abo_history.change_history') }}
</h5>
@if(isset($isAdmin) && $isAdmin && $user_abo->getInitialItems()->isNotEmpty())
{{-- <form action="{{ route('admin_abos_rollback', [$user_abo->id]) }}" method="POST"
onsubmit="return confirm('{{ __('abo_history.rollback_confirm') }}')">
@csrf
<button type="submit" class="btn btn-sm btn-outline-danger">
<i class="fas fa-undo"></i> {{ __('abo_history.rollback_btn') }}
</button>
</form>
--}}
@endif
</div>
@if($statusHistory->isNotEmpty())
<h6 class="font-weight-semibold text-muted mb-2">{{ __('abo_history.status_history_title') }}</h6>
<div class="table-responsive mb-4">
<table class="table table-sm table-striped mb-0">
<thead>
<tr>
<th>{{ __('abo_history.col_date') }}</th>
<th>{{ __('abo_history.col_action') }}</th>
<th>{{ __('abo_history.col_details') }}</th>
<th>{{ __('abo_history.col_changed_by') }}</th>
<th>{{ __('abo_history.col_channel') }}</th>
</tr>
</thead>
<tbody>
@foreach($statusHistory as $statusEntry)
<tr>
<td class="text-nowrap small">{{ $statusEntry->getFormattedDate() }}</td>
<td>{!! $statusEntry->getActionBadge() !!}</td>
<td class="small">{{ $statusEntry->getDescription() }}</td>
<td class="small">{{ $statusEntry->getActorName() }}</td>
<td>{!! $statusEntry->getChannelBadge() !!}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
@if($changeHistory->isEmpty())
<p class="text-muted mb-0">
<i class="fas fa-info-circle"></i> {{ __('abo_history.no_changes') }}
</p>
@else
<div class="table-responsive">
<table class="table table-sm table-striped mb-0">
<thead>
<tr>
<th>{{ __('abo_history.col_date') }}</th>
<th>{{ __('abo_history.col_action') }}</th>
<th>{{ __('abo_history.col_product') }}</th>
<th>{{ __('abo_history.col_details') }}</th>
<th class="text-right">{{ __('tables.price') }} <small class="text-muted">({{ $priceLabel }})</small></th>
<th>{{ __('abo_history.col_changed_by') }}</th>
<th>{{ __('abo_history.col_channel') }}</th>
</tr>
</thead>
<tbody>
@foreach($changeHistory as $entry)
<tr>
<td class="text-nowrap small">{{ $entry->getFormattedDate() }}</td>
<td>{!! $entry->getActionBadge() !!}</td>
<td>
<strong>{{ $entry->product_name }}</strong>
@if($entry->product_number)
<br><small class="text-muted">{{ $entry->product_number }}</small>
@endif
</td>
<td class="small">{{ $entry->getChangeDescription() }}</td>
<td class="text-right text-nowrap">{{ $entry->getFormattedTotalPrice() }} &euro;</td>
<td class="small">{{ $entry->changed_by_name }}</td>
<td>{!! $entry->getChannelBadge() !!}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>