- Laravel 11, Blade, Alpine.js, Tailwind CSS - Produkt- & Kategorieverwaltung mit Varianten - Checkout (Vorkasse + Rechnung), Session-Warenkorb - Admin-Backend (Dashboard, Bestellungen, Kunden, CMS) - DSGVO-konform: Cookie-Consent, Impressum, Widerruf, AGB - PDF-Rechnung via dompdf, SMTP-Mailversand - Kundenverwaltung mit manueller Freischaltung Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
114 lines
6.5 KiB
PHP
114 lines
6.5 KiB
PHP
@extends('layouts.admin')
|
|
@section('title', 'Bestellung ' . $order->order_number)
|
|
@section('content')
|
|
<div class="flex items-center justify-between mb-6">
|
|
<div>
|
|
<a href="{{ route('admin.orders.index') }}" class="text-sm text-gray-500 hover:text-blue-600">← Alle Bestellungen</a>
|
|
<h2 class="text-xl font-bold mt-1">{{ $order->order_number }}</h2>
|
|
<p class="text-sm text-gray-400">{{ $order->created_at->format('d.m.Y H:i') }} Uhr</p>
|
|
</div>
|
|
<div class="flex gap-2">
|
|
<a href="{{ route('admin.orders.pdf', $order) }}" class="bg-gray-100 px-4 py-2 rounded text-sm hover:bg-gray-200">PDF-Rechnung herunterladen</a>
|
|
<form method="POST" action="{{ route('admin.orders.invoice', $order) }}">
|
|
@csrf
|
|
<button class="bg-blue-100 text-blue-700 px-4 py-2 rounded text-sm hover:bg-blue-200">Rechnung erneut mailen</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-3 gap-6">
|
|
<div class="col-span-2 space-y-6">
|
|
{{-- Artikel --}}
|
|
<div class="bg-white rounded shadow overflow-hidden">
|
|
<div class="px-5 py-3 border-b font-semibold">Bestellpositionen</div>
|
|
<table class="w-full text-sm">
|
|
<thead class="bg-gray-50"><tr><th class="px-4 py-2 text-left">Artikel</th><th class="px-4 py-2 text-center">Menge</th><th class="px-4 py-2 text-right">Einzelpreis</th><th class="px-4 py-2 text-right">MwSt.</th><th class="px-4 py-2 text-right">Gesamt</th></tr></thead>
|
|
<tbody class="divide-y">
|
|
@foreach($order->items as $item)
|
|
<tr>
|
|
<td class="px-4 py-2">{{ $item->product_name }}@if($item->variant_label) <span class="text-gray-400">({{ $item->variant_label }})</span>@endif</td>
|
|
<td class="px-4 py-2 text-center">{{ $item->quantity }}</td>
|
|
<td class="px-4 py-2 text-right">{{ number_format($item->unit_price, 2, ',', '.') }} €</td>
|
|
<td class="px-4 py-2 text-right">{{ number_format($item->tax_rate, 0) }} %</td>
|
|
<td class="px-4 py-2 text-right font-medium">{{ number_format($item->line_total, 2, ',', '.') }} €</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
<tfoot class="border-t">
|
|
<tr><td colspan="4" class="px-4 py-2 text-right text-gray-500">Zwischensumme</td><td class="px-4 py-2 text-right">{{ number_format($order->subtotal, 2, ',', '.') }} €</td></tr>
|
|
<tr><td colspan="4" class="px-4 py-2 text-right text-gray-500">MwSt. gesamt</td><td class="px-4 py-2 text-right">{{ number_format($order->tax_total, 2, ',', '.') }} €</td></tr>
|
|
<tr><td colspan="4" class="px-4 py-2 text-right text-gray-500">Versand</td><td class="px-4 py-2 text-right">{{ number_format($order->shipping_cost, 2, ',', '.') }} €</td></tr>
|
|
<tr class="font-bold"><td colspan="4" class="px-4 py-2 text-right">Gesamt</td><td class="px-4 py-2 text-right text-lg">{{ number_format($order->total, 2, ',', '.') }} €</td></tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
|
|
{{-- Adressen --}}
|
|
<div class="grid grid-cols-2 gap-4">
|
|
@foreach(['billing' => 'Rechnungsadresse', 'shipping' => 'Lieferadresse'] as $type => $label)
|
|
@php $addr = $order->addresses->where('type', $type)->first(); @endphp
|
|
@if($addr)
|
|
<div class="bg-white rounded shadow p-5">
|
|
<h3 class="font-semibold mb-2">{{ $label }}</h3>
|
|
<p class="text-sm">
|
|
{{ $addr->full_name }}<br>
|
|
@if($addr->company){{ $addr->company }}<br>@endif
|
|
{{ $addr->street }}<br>
|
|
{{ $addr->zip }} {{ $addr->city }}<br>
|
|
{{ $addr->country }}
|
|
@if($addr->phone)<br>{{ $addr->phone }}@endif
|
|
</p>
|
|
</div>
|
|
@endif
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Status & Aktionen --}}
|
|
<div class="space-y-4">
|
|
<div class="bg-white rounded shadow p-5">
|
|
<h3 class="font-semibold mb-3">Bestelldetails</h3>
|
|
<dl class="space-y-2 text-sm">
|
|
<div class="flex justify-between"><dt class="text-gray-500">Zahlungsart</dt><dd>{{ $order->payment_label }}</dd></div>
|
|
<div class="flex justify-between"><dt class="text-gray-500">Status</dt>
|
|
<dd><span class="px-2 py-0.5 rounded text-xs bg-blue-100 text-blue-700">{{ $order->status_label }}</span></dd>
|
|
</div>
|
|
<div class="flex justify-between"><dt class="text-gray-500">Zahlung</dt><dd>{{ $order->paid_at?->format('d.m.Y') ?? '—' }}</dd></div>
|
|
@if($order->tracking_code)<div class="flex justify-between"><dt class="text-gray-500">Tracking</dt><dd class="font-mono">{{ $order->tracking_code }}</dd></div>@endif
|
|
</dl>
|
|
</div>
|
|
|
|
<div class="bg-white rounded shadow p-5">
|
|
<h3 class="font-semibold mb-3">Status ändern</h3>
|
|
<form method="POST" action="{{ route('admin.orders.status', $order) }}">
|
|
@csrf @method('PUT')
|
|
<div class="mb-3">
|
|
<select name="status" class="w-full border rounded px-3 py-2 text-sm">
|
|
@foreach(\App\Models\Order::$statusLabels as $key => $label)
|
|
<option value="{{ $key }}" {{ $order->status === $key ? 'selected' : '' }}>{{ $label }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="block text-xs text-gray-500 mb-1">Trackingcode (optional)</label>
|
|
<input type="text" name="tracking_code" value="{{ $order->tracking_code }}" class="w-full border rounded px-3 py-2 text-sm">
|
|
</div>
|
|
<button class="w-full bg-blue-600 text-white py-2 rounded hover:bg-blue-700 text-sm">Status speichern</button>
|
|
</form>
|
|
</div>
|
|
|
|
@if($order->user)
|
|
<div class="bg-white rounded shadow p-5">
|
|
<h3 class="font-semibold mb-2">Kunde</h3>
|
|
<p class="text-sm">{{ $order->user->name }}<br>{{ $order->user->email }}</p>
|
|
</div>
|
|
@elseif($order->guest_email)
|
|
<div class="bg-white rounded shadow p-5">
|
|
<h3 class="font-semibold mb-2">Gast</h3>
|
|
<p class="text-sm">{{ $order->guest_email }}</p>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endsection
|