@extends('layouts.admin') @section('title', 'Detail Order: ' . $order->order_number) @section('page_title', 'Kelola Pesanan: ' . $order->order_number) @section('content')
@php $src = $order->source_badge; @endphp {{ $src['label'] }}

{{ $order->order_number }}

Dipesan pada: {{ $order->created_at->format('d F Y, H:i') }} WIB
@if(!in_array($order->order_status, ['returned', 'completed', 'cancelled'])) Edit Sewa / Ganti Gaun @endif Struk POS Cetak Invoice @if($order->shipping_tracking_number) Label Resi @endif {{ $order->status_badge['label'] }}
Nama Customer:
{{ $order->customer_name }}
No. Identitas (KTP/NIK):
{{ $order->customer_id_number ?? '-' }}
Email:
{{ $order->customer_email ?? '-' }}
@if($order->customer_id_photo)
Foto KTP / Identitas Customer:
@endif
Remark / Catatan Sewa:
{{ $order->remark ?: 'Belum ada remark khusus untuk pesanan sewa ini.' }}
@csrf
Jadwal Sewa
Mulai: {{ $order->rental_start_date->format('l, d F Y') }}
Kembali: {{ $order->rental_end_date->format('l, d F Y') }}
Durasi: {{ $order->duration_days }} Hari
Pengiriman & Pengembalian
Metode Ambil: {{ $order->delivery_type === 'studio_pickup' ? 'Ambil Sendiri di Studio' : 'Kurir ' . strtoupper($order->shipping_courier) . ' (' . $order->shipping_service . ')' }}
Metode Balik: {{ $order->return_type === 'studio_return' ? 'Kembalikan ke Studio' : 'Kirim Balik via Kurir' }}
@if($order->shipping_tracking_number)
Nomor Resi Pengiriman:
{{ $order->shipping_tracking_number }} @if($order->biteship_tracking_url) Lacak @endif @if($order->biteship_label_url) Cetak Label @endif
@endif @if($order->delivery_type === 'courier' && $order->destination_address)
Alamat Tujuan Pengiriman:
{{ $order->destination_address }}
@if($order->destination_subdistrict) Kel. {{ $order->destination_subdistrict }}, @endif @if($order->destination_district) Kec. {{ $order->destination_district }}, @endif {{ $order->destination_city }}, {{ $order->destination_province }} {{ $order->destination_postal_code }}
@if($order->destination_notes)
Patokan: {{ $order->destination_notes }}
@endif @if($order->destination_lat && $order->destination_lng)
Buka Titik GPS (Google Maps) {{ $order->destination_lat }}, {{ $order->destination_lng }}
@endif
@endif
Gaun yang Disewa ({{ $order->items->count() }} Item)
@if(!in_array($order->order_status, ['returned', 'completed', 'cancelled'])) Ganti Gaun / Edit Sewa @endif
@foreach($order->items as $item) @endforeach @if($order->additional_fee > 0) @endif @if($order->discount_amount > 0) @endif @if($order->shipping_cost > 0) @endif @if($order->unique_code > 0) @endif
Foto Kode & Nama Gaun Size / Warna Harga Sewa Deposit Subtotal
{{ $item->dress->name }}
{{ $item->dress->name }}
{{ $item->dress->code }}
{{ $item->dress->size }} {{ $item->dress->color }} Rp {{ number_format($item->price_per_unit, 0, ',', '.') }} Rp {{ number_format($item->deposit_per_unit, 0, ',', '.') }} Rp {{ number_format($item->subtotal + $item->deposit_per_unit, 0, ',', '.') }}
Subtotal Sewa Gaun: {{ $order->formatted_subtotal }}
Biaya Tambahan Tambahan Biaya{{ $order->additional_fee_note ? ' (' . $order->additional_fee_note . ')' : '' }}: + {{ $order->formatted_additional_fee }}
Potongan Diskon: - Rp {{ number_format($order->discount_amount, 0, ',', '.') }}
Penghasilan Murni Sewa (Pure Studio): {{ $order->formatted_pure_rental }}
Titipan Deposit Jaminan (Refundable): {{ $order->formatted_deposit }}
Logistik Ongkos Kirim Ekspedisi: {{ $order->formatted_shipping_cost }}
Kode Unik Transfer: {{ $order->unique_code }}
Grand Total (Total Kas Masuk): {{ $order->formatted_grand_total }}
@if(in_array($order->order_status, ['in_rental', 'shipped', 'ready_for_pickup', 'confirmed']))
Pengembalian Gaun
@if(\Carbon\Carbon::today() < $order->rental_end_date) Kembali Lebih Awal @elseif(\Carbon\Carbon::today() > $order->rental_end_date) Terlambat @else Jadwal Hari Ini @endif

Customer ingin mengembalikan gaun {{ \Carbon\Carbon::today() < $order->rental_end_date ? 'lebih awal sebelum batas waktu 4 hari (' . $order->rental_end_date->translatedFormat('d M Y') . ')' : 'hari ini' }}? Klik tombol di bawah untuk inspeksi kondisi, catat deposit jaminan, dan alur laundry/penjahit.

@elseif($order->order_status === 'returned' || $order->order_status === 'completed')
Gaun Sudah Diterima Kembali
Selesai Kembali
Tanggal Terima: {{ $order->actual_return_date ? $order->actual_return_date->translatedFormat('l, d F Y H:i') : '-' }}
@if($order->return_notes)
{{ $order->return_notes }}
@endif
@endif @if($order->delivery_type === 'courier') @php $isBiteshipCancelled = $order->isBiteshipCancelled(); @endphp
Pengiriman Kurir Biteship
@if($isBiteshipCancelled) Resi Dibatalkan @elseif($order->shipping_tracking_number) Resi Terbit @elseif($order->payment_status === 'paid') Siap Buat Resi @else Tunggu Lunas @endif
Kurir Terpilih:
{{ $order->shipping_courier ?: 'Belum dipilih' }} ({{ $order->shipping_service ?: '-' }})
Ongkir Terbayar: {{ $order->formatted_shipping_cost }}
Kota Tujuan: {{ $order->destination_city ?: 'Alamat Customer' }}
@if($isBiteshipCancelled)
Pengiriman Biteship Dibatalkan ({{ strtoupper($order->biteship_status) }})
Resi sebelumnya {{ $order->shipping_tracking_number }} telah dibatalkan / gagal pick-up oleh pihak kurir.
Silakan periksa kembali alamat/kurir dan klik tombol di bawah untuk membuat ulang resi baru ke Biteship.
@if($order->payment_status === 'paid')
@csrf
@endif @elseif($order->shipping_tracking_number)
Nomor Resi / Waybill ID:
{{ $order->shipping_tracking_number }}
@if($order->biteship_status)
Status Biteship: {{ $order->biteship_status }}
@endif
@elseif($order->payment_status === 'paid')
Status pembayaran Lunas. Silakan buat resi dan request pickup kurir secara otomatis.
@csrf
@else
Tombol generate resi Biteship akan aktif otomatis setelah status pembayaran menjadi Lunas.
@endif
@endif
Update Status Rental
@csrf
Verifikasi Pembayaran {{ ucfirst($order->payment_status) }}
Metode Bayar: {{ $order->payment_method }}
Pure Sewa Gaun: {{ $order->formatted_pure_rental }}
Deposit Titipan: {{ $order->formatted_deposit }}
@if($order->shipping_cost > 0)
Ongkir Kurir: {{ $order->formatted_shipping_cost }}
@endif
Total Masuk Kas: {{ $order->formatted_grand_total }}
@if($order->payment_sender_name)
Rekening Pengirim: {{ $order->payment_sender_name }}
@endif @if($order->paid_at)
Waktu Lunas: {{ $order->paid_at->format('d/m/y H:i') }}
@else
Batas Waktu Bayar: @if($order->isPaymentExpired()) Kadaluarsa ({{ $order->payment_deadline ? $order->payment_deadline->format('d/m H:i') : '-' }}) @else {{ $order->payment_deadline ? $order->payment_deadline->format('d/m/Y H:i') : '-' }} WIB @endif
@endif
@if($order->payment_proof)
@if($order->payment_sender_name) a.n {{ $order->payment_sender_name }} @endif
@php $isPdf = str_ends_with(strtolower($order->payment_proof), '.pdf'); @endphp @if($isPdf)
Dokumen Bukti Transfer (PDF)
Buka / Unduh Dokumen PDF
@else Bukti Transfer @endif
@if($order->payment_status !== 'paid')
@csrf
@csrf
@endif @else
Customer belum mengunggah bukti pembayaran QRIS / Transfer.
@endif
@csrf
Pengembalian Deposit Jaminan
Rekening Tujuan: @if($order->is_deposit_bca) BCA (Bebas Biaya Admin) @elseif($order->deposit_bank_name) Non-BCA (+Biaya Rp 2.500) @else Belum Diisi @endif
Bank:
{{ $order->deposit_bank_name ?: '-' }}
No. Rekening:
{{ $order->deposit_bank_account_number ?: '-' }} @if($order->deposit_bank_account_number) @endif
Nama:
{{ $order->deposit_bank_account_name ?: '-' }}
@if(!$order->is_deposit_bca && $order->deposit_bank_name)
Note: Selain bank BCA akan dikenakan biaya transfer Rp 2.500.
@endif
Total Deposit Ditahan: {{ $order->formatted_deposit }}
Status Pengembalian: {{ ucfirst($order->deposit_refund_status) }}
@if($order->deposit_refunded_at)
Ditransfer pada: {{ $order->deposit_refunded_at->format('d/m/y H:i') }}
@endif
@if($order->deposit_refund_status !== 'refunded')
@csrf
@php $suggestedRefund = (!$order->is_deposit_bca && $order->deposit_bank_name && $order->total_deposit > 2500) ? (int)($order->total_deposit - 2500) : (int)$order->total_deposit; @endphp
@php $defaultRefundNote = $order->deposit_bank_name ? "Transfer ke {$order->deposit_bank_name} {$order->deposit_bank_account_number} a/n {$order->deposit_bank_account_name}" . (!$order->is_deposit_bca ? ' (Dipotong biaya transfer Rp 2.500)' : '') : ''; @endphp
@else
Deposit sebesar Rp {{ number_format($order->deposit_refund_amount, 0, ',', '.') }} sudah dikembalikan ke customer. @if($order->deposit_notes)
Catatan: {{ $order->deposit_notes }}
@endif
@endif
@push('scripts') @endpush @endsection