@extends('layouts.admin') @section('title', 'Detail Penjualan #' . $sale->id) @section('content')

Detail Penjualan #{{ $sale->id }}

Dibuat pada {{ $sale->created_at->format('d M Y H:i') }}

@if ($sale->product && $sale->product->product_image)
{{ $sale->product->product_title }}

{{ $sale->product->product_title ?? 'N/A' }}

Produk Penjualan

@endif

Informasi Pembeli

Nama: {{ $sale->order->customer_name ?? 'N/A' }}
Email: {{ $sale->order->customer_email ?? 'N/A' }}
Telepon: {{ $sale->order->phone_number ?? 'N/A' }}
Alamat: {{ $sale->order->address ?? 'N/A' }}

Detail Penjualan

Produk: {{ Str::limit($sale->product->product_title ?? 'N/A', 30) }}
Quantity: {{ $sale->quantity }}
Harga: Rp {{ number_format($sale->unit_price, 0, ',', '.') }}
Total: Rp {{ number_format($sale->total_price, 0, ',', '.') }}

Status

@php $statusConfig = [ 'selesai' => [ 'bg' => 'bg-green-100 dark:bg-green-900/40', 'text' => 'text-green-700 dark:text-green-300', 'icon' => 'fa-check-circle' ], 'dibatalkan' => [ 'bg' => 'bg-red-100 dark:bg-red-900/40', 'text' => 'text-red-700 dark:text-red-300', 'icon' => 'fa-times-circle' ], ]; $config = $statusConfig[$sale->status] ?? [ 'bg' => 'bg-yellow-100 dark:bg-yellow-900/40', 'text' => 'text-yellow-700 dark:text-yellow-300', 'icon' => 'fa-clock' ]; @endphp
{{ ucfirst($sale->status) }}
@php $paymentMethodColors = [ 'transfer' => 'bg-blue-100 dark:bg-blue-900/40 text-blue-800 dark:text-blue-300', 'qris' => 'bg-green-100 dark:bg-green-900/40 text-green-800 dark:text-green-300', 'dp' => 'bg-purple-100 dark:bg-purple-900/40 text-purple-800 dark:text-purple-300', 'cod' => 'bg-orange-100 dark:bg-orange-900/40 text-orange-800 dark:text-orange-300', ]; $methodClass = $paymentMethodColors[strtolower($sale->payment_method ?? '')] ?? 'bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300'; @endphp
{{ strtoupper($sale->payment_method ?? 'N/A') }}
{{ $sale->sale_date ? $sale->sale_date->format('d M Y H:i') : 'N/A' }}
@if($sale->order)

Informasi Order

@if($sale->user_id)
User ID: {{ $sale->user_id }}
@endif
@endif @if (!empty($sale->notes))

Catatan

{{ $sale->notes }}

@endif @endsection