@extends('admin::index') @section('content')

{{ $header or trans('admin.title') }} {{ $description or trans('admin.description') }}

@include('partials.breadcrumb')
@include('partials.error') @include('admin::partials.exception') @include('admin::partials.toastr') {{-- MAIN CONTENT --}}

{{ __("Mã đơn hàng") }}: {{ $item->code }}

{{ $item->status }}

{{ __("Thông tin khách hàng") }}

@if($customer = $item->customer)
{{ $customer->fullname }} {{ $customer->type_label }}
{{ $customer->phone }}
{{ $customer->address }}
@else
{{ __('Chưa có cập nhật thông tin khách hàng') }}
@endif

{{ __("Thông tin đơn hàng") }}

@foreach($item->products as $prod) @php $unitLabel = $prod->pivot->unit_id ? (\App\Models\Unit::find($prod->pivot->unit_id)->name ?? '') : $prod->unit; @endphp @endforeach
{{$prod->name}}@if($unitLabel) ({{ $unitLabel }})@endif
x {{$prod->pivot->qty}}
{{number_format($prod->pivot->price * $prod->pivot->qty, 1)}} ₫
@if($item->debt_amount > 0) @endif
{{ __('Số sản phẩm') }} {{ $item->count }}
{{ __('Tổng tiền hàng') }} {{ number_format($item->subtotal) }} ₫
{{ __('Tiền giảm') }} {{ number_format($item->discount_amount) }} ₫
{{ __('Thành tiền') }} {{ number_format($item->total) }} ₫
{{ __('Tiền nợ') }} {{ number_format($item->debt_amount) }} ₫
@if($item->debt_locked) {{ __('Đã cộng vào công nợ') }} @else {{ __('Chưa cộng — đơn còn nháp') }} @endif
@if($item->is_editable) {{ __('Chỉnh sửa') }} @endif @if($item->status == 'draft') {{ __('Tạo đơn') }} @endif {{ Form::open(array('route' => ['orders.update', $item->id], 'method' => 'POST', 'pjax-container'=>'', 'id' => 'createOrderForm' )) }} {{ Form::close() }}
@endsection @php @endphp