@extends('admin.layouts.main') @section('title', 'Chi tiết đơn hàng') @section('css') @endsection @section('content')
@if(session("alert"))
{{session("alert")}}
@elseif(session('error'))
{{session("error")}}
@endif
#{{ $data->code }}
{{ $data->created_at->format('d/m/Y - H:i') }}
@foreach ($data->listStatus as $status) @if ($status['status'] == $data->status) @php $statusClass = 'status-pending'; if ($status['status'] == 2) { $statusClass = 'status-processing'; } elseif ($status['status'] > 3) { $statusClass = 'status-completed'; } elseif ($status['status'] == -1) { $statusClass = 'status-cancelled'; } @endphp {{ $status['name'] }} @endif @endforeach {{ $data->thanhtoan == 1 ? 'Đã thanh toán' : 'Chưa thanh toán' }}
@if ($data->thanhtoan != 1 && $data->status !=4) Sửa đơn hàng @endif {{-- 🖨️ In Hóa đơn Xuất kho --}}
📦 Chi tiết sản phẩm
@foreach ($data->orders as $item)
{{ $item->name }}
{{ $item->name }}
SKU: {{ $item->product->masp ?? '' }} @if (isset($item->product->content4) && $item->product->content4 != '') Quy cách: {{ $item->product->content4 }} @endif
@if (!empty($item->option_name))

Loại: {{ $item->option_name }}

@endif
SL: {{ $item->quantity }}
{{ number_format($item->new_price) }} đ @if ($item->old_price - $item->new_price > 0) {{ number_format($item->old_price) }} đ @endif
@endforeach
Số lượng sản phẩm {{ $data->quantity }}
Tổng giá trị đơn hàng {{ number_format($data->total) }} đ
@php $thanhtoan = App\Models\Setting::find($data->httt); @endphp @isset($thanhtoan)
Hình thức thanh toán: {{ $thanhtoan->name }}
@endisset
@if ($data->status !== -1)
@endif {{--@if($data->thanhtoan == 0) @endif--}}
📝 Ghi chú đơn hàng
{!! $data->note ?? 'Chưa có ghi chú nào cho đơn hàng này.' !!}
⚡ Xác Thực Đơn Hàng
Chuyển trạng thái đơn hàng
@if ($data->status !== -1 && $data->status !== 4)
@else
@if ($data->status == -1) Đơn hàng đã bị hủy @else Đơn hàng đã hoàn tất @endif
@endif
👤 Thông Tin Người Mua
{{ $data->user->name ?? $data->name }}
Đã đặt {{ $data->quantity }} sản phẩm
Tổng tiền {{ number_format($data->total) }} đ
@if ($data->status !== -1 && $data->status !== 4)
@endif
🚚 Thông tin giao hàng @if ($data->vat == 1) (Có VAT) @endif
Họ Tên: {{ $data->name }}
{{-- --}}
Số điện thoại: {{ $data->phone }}
@if ($data->email && $data->email != '')
Email: {{ $data->email }}
@endif
📍 Địa chỉ giao hàng
{{ $data->address_detail }}
@if ($data->vat == 1)
📍 Xuất hóa đơn VAT
Tên công ty: {{ $data->user->company }}
Mã số thuế: {{ $data->user->tax }}
Địa chỉ công ty: {{ $data->user->address_company }}
Email nhận hóa đơn : {{ $data->user->email_bill }}
@endif
@endsection @section('js') @if (session('success')) @endif @if (session('errors')) @endif @endsection