@php $currentCompany = app()->bound('current_company') ? app('current_company') : null; $logoPath = $currentCompany ? ($currentCompany->logo_dark ?: $currentCompany->logo_light) : null; $statusLabels = [ 'draft' => __('orders.status_draft'), 'active' => __('orders.status_active'), 'completed' => __('orders.status_completed'), 'cancelled' => __('orders.status_cancelled'), 'delivered' => __('orders.status_delivered'), 'Draft' => __('orders.status_draft'), 'In Production' => __('orders.status_in_production'), 'Ready for Trial' => __('orders.status_ready_for_trial'), 'Completed' => __('orders.status_completed'), 'Delivered' => __('orders.status_delivered'), ]; @endphp
{{ __('orders.order') }} #{{ $order->order_number }}
@if($currentCompany)
@if($logoPath) Logo @endif {{ $currentCompany->name }}
@if($currentCompany->address){{ $currentCompany->address }}
@endif @if($currentCompany->phone)Tel: {{ $currentCompany->phone }}@endif @if($currentCompany->phone && $currentCompany->email) | @endif @if($currentCompany->email)E-posta: {{ $currentCompany->email }}@endif
@endif

{{ __('orders.order') }} #{{ $order->order_number }}

{{ __('orders.order_date') }}: {{ $order->order_date?->format('d.m.Y') }}
{{ __('invoices.billed_to') ?? 'Alıcı:' }}
{{ $order->customer->first_name }} {{ $order->customer->last_name }}
{{ $order->customer->customer_code }}
{{ $order->customer->phone }} @if($order->customer->address)
{{ $order->customer->address }} @endif
@foreach($order->items as $item) @php $measurementDetails = $item->details->where('type', 'measurement'); if ($measurementDetails->isEmpty() && $item->measurement) { $measurementDetails = $item->measurement->items; } @endphp

{{ $item->clothType->title }}

@moneyWithCurrency($item->price, $order->currency)
{{ __('orders.trial_date') }}: {{ $item->trial_date ? $item->trial_date->format('d.m.Y') : __('orders.not_available') }}
{{ __('orders.delivery_date') }}: {{ $item->delivery_date ? $item->delivery_date->format('d.m.Y') : __('orders.not_available') }}
{{ __('orders.specs_attributes') }} {{ __('orders.measurements') }}
@forelse($item->details->where('type', 'attribute') as $detail)
{{ $detail->label }}: @if($detail->image_path) {{ $detail->label }} @endif {{ $detail->value }}
@empty
{{ __('orders.not_available') }}
@endforelse
@forelse($measurementDetails as $detail)
{{ $detail->label ?? $detail->measureType?->title }}: {{ $detail->value }}
@empty
{{ __('orders.not_available') }}
@endforelse
@endforeach
@if($order->note)

{{ __('orders.order_note') }}

{{ $order->note }}
@endif
{{ __('orders.total_price') }} @moneyWithCurrency($order->total_price, $order->currency)
{{ __('orders.advance_payment') }} @moneyWithCurrency($order->advance_payment, $order->currency)
{{ __('orders.balance_due') }} @moneyWithCurrency($order->balance, $order->currency)
{{ __('common.status') }}
{{ $statusLabels[$order->status] ?? $order->status }}