mivita/resources/views/sys/tools/abo-orders-overview.blade.php
2026-04-10 17:15:27 +02:00

135 lines
7.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold mb-4">
Abo-Bestellungen Soll-Brutto vs. tatsächlich eingezogen (ShoppingPayment)
</h4>
<div class="card mb-4">
<div class="card-body">
<div class="btn-group mb-3" role="group">
<a href="{{ route('sysadmin_tool', ['abo_orders_overview']) }}"
class="btn btn-{{ $filter === 'all' ? 'primary' : 'outline-primary' }}">Alle</a>
<a href="{{ route('sysadmin_tool', ['abo_orders_overview']) }}?filter=berater"
class="btn btn-{{ $filter === 'berater' ? 'warning' : 'outline-warning' }}">Berater</a>
<a href="{{ route('sysadmin_tool', ['abo_orders_overview']) }}?filter=kunde"
class="btn btn-{{ $filter === 'kunde' ? 'info' : 'outline-info' }}">Kunden</a>
</div>
<div class="row">
<div class="col-md-3">
<div class="alert alert-info mb-0">
<strong>Gesamt Bestellungen:</strong> {{ $summary['total_orders'] }}
</div>
</div>
<div class="col-md-3">
<div class="alert alert-{{ $summary['affected_orders'] > 0 ? 'danger' : 'success' }} mb-0">
<strong>Betroffene Bestellungen:</strong> {{ $summary['affected_orders'] }}
</div>
</div>
<div class="col-md-3">
<div class="alert alert-{{ $summary['total_diff'] != 0 ? 'danger' : 'success' }} mb-0">
<strong>Fehlbetrag gesamt:</strong> {{ number_format($summary['total_diff'], 2, ',', '.') }} &euro;
</div>
</div>
<div class="col-md-3">
<div class="alert alert-warning mb-0">
<strong>Hinweis:</strong> Eingezogen = Summe <code>shopping_payments.amount</code> bei TX
paid / extern_paid / invoice_paid. Soll = <code>total_shipping</code> (Brutto).
</div>
</div>
</div>
</div>
</div>
<div class="card mb-4">
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-sm">
<thead class="thead-dark">
<tr>
<th>Abo-Order ID</th>
<th>Abo ID</th>
<th>Order ID</th>
<th>User</th>
<th>Typ</th>
<th class="text-right">Netto+Versand (subtotal_ws)</th>
<th class="text-right">MwSt</th>
<th class="text-right">Soll Brutto (total_shipping)</th>
<th class="text-right">Eingezogen (Zahlung)</th>
<th>Zahlungs-TX</th>
<th class="text-right text-danger">Differenz (Soll Ist)</th>
<th>Status</th>
<th>Bezahlt</th>
<th>TX-Action</th>
<th>Datum</th>
</tr>
</thead>
<tbody>
@foreach ($rows as $row)
<tr class="{{ isset($row['diff']) && $row['diff'] != 0 ? 'table-danger' : '' }}">
<td>{{ $row['abo_order_id'] }}</td>
<td>{{ $row['abo_id'] }}</td>
<td>{!! $row['order_id'] !!}</td>
<td>
<small>
@if ($row['user_id'])
<strong>#{{ $row['user_id'] }}</strong>
@endif
{{ $row['user_name'] }}<br>
{{ $row['user_email'] }}
</small>
</td>
<td>
@if ($row['is_for'] === 'me')
<span class="badge badge-outline-warning-dark">Berater</span>
@else
<span class="badge badge-outline-info">Kunde</span>
@endif
</td>
<td class="text-right">{{ number_format($row['subtotal_ws'], 2, ',', '.') }} &euro;</td>
<td class="text-right">{{ number_format($row['tax'], 2, ',', '.') }} &euro;</td>
<td class="text-right">{{ number_format($row['total_shipping'], 2, ',', '.') }} &euro;</td>
<td class="text-right">
@if ($row['actual_charged_eur'] !== null)
{{ number_format($row['actual_charged_eur'], 2, ',', '.') }} &euro;
@else
<span class="text-muted"
title="Keine Zahlung mit Status paid/extern_paid/invoice_paid"></span>
@endif
</td>
<td>
<small>{{ $row['payment_txactions'] ?: '' }}</small>
@if (($row['payment_count'] ?? 0) > 1)
<span class="badge badge-secondary"
title="Anzahl Zahlungszeilen">{{ $row['payment_count'] }}</span>
@endif
</td>
<td class="text-right">
@if ($row['diff'] === null)
<span class="text-muted"></span>
@elseif($row['diff'] != 0)
<strong class="text-danger">{{ number_format($row['diff'], 2, ',', '.') }}
&euro;</strong>
@else
<span class="text-success">0,00 &euro;</span>
@endif
</td>
<td>{!! $row['status_badge'] ?? '<span class="badge badge-pill badge-secondary">' . $row['status'] . '</span>' !!}</td>
<td>
@if ($row['paid'])
<span class="badge badge-success">Ja</span>
@else
<span class="badge badge-danger">Nein</span>
@endif
</td>
<td>{{ $row['txaction'] }}</td>
<td><small>{{ $row['created_at'] ? $row['created_at']->format('d.m.Y H:i') : '-' }}</small>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection