@extends('layouts.app') @section('content')

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

@can('Update:Order') {{ __('orders.edit') }} @endcan @if($order->invoice && $order->invoice->due_amount > 0) @endif
@if($order->status === 'pending_approval' || $order->status === 'Pending Approval') @php $isOwner = \App\Services\NotificationService::isCompanyOwnerOrAdmin(auth()->user()); @endphp
Sipariş Onay Bekliyor
Bu siparişte veya müşterinin bu kıyafet türüne ait ölçülerinde bir değişiklik yapılmıştır. Siparişin üretime alınabilmesi için onaylanması gerekmektedir.
@if($isOwner)
@csrf
@endif
@endif @if($errors->any())
{{ $errors->first() }}
@endif
{{ substr($order->customer->first_name, 0, 1) }}{{ substr($order->customer->last_name, 0, 1) }}
{{ $order->customer->first_name }} {{ $order->customer->last_name }}
{{ $order->customer->customer_code }}
{{ __('orders.financial_summary') }}
{{ __('orders.total_price') }}
@moneyWithCurrency($order->total_price, $order->currency)
{{ __('orders.advance_payment') }}
@moneyWithCurrency($order->advance_payment, $order->currency)
{{ __('orders.balance_due') }}
@moneyWithCurrency($order->invoice ? $order->invoice->due_amount : $order->balance, $order->currency)
@if($order->invoice && $order->invoice->payments->isNotEmpty())
{{ __('invoices.payment_history') }}
@foreach($order->invoice->payments as $payment)
{{ $payment->payment_date->translatedFormat('d F Y') }} ({{ __("invoices.{$payment->payment_method}") ?? $payment->payment_method }}) @if(str_contains(strtolower($payment->notes ?? ''), 'kapora') || str_contains(strtolower($payment->notes ?? ''), 'advance')) {{ __('invoices.down_payment') }} @else {{ __('invoices.normal_payment') }} @endif @if($payment->notes && !str_contains(strtolower($payment->notes), 'kapora') && !str_contains(strtolower($payment->notes), 'advance')) ({{ $payment->notes }}) @endif +@moneyWithCurrency($payment->amount, $payment->currency)
@endforeach
@endif
@if($order->invoice_id) @else
@csrf
@endif
{{ __('orders.general_info') }}
{{ __('orders.order_date') }}
{{ $order->order_date->translatedFormat('d M Y') }}
{{ __('common.status') }}
@php $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 {{ $statusLabels[$order->status] ?? $order->status }}
{{ __('orders.responsible') }}
{{ $order->responsibleUser->name ?? __('orders.not_available') }}

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

@foreach($order->items as $item)

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

@moneyWithCurrency($item->price, $order->currency)
{{ __('orders.trial_date') }}:
{{ $item->trial_date ? $item->trial_date->translatedFormat('d M Y') : __('orders.not_available') }}
{{ __('orders.delivery_date') }}:
{{ $item->delivery_date ? $item->delivery_date->translatedFormat('d M Y') : __('orders.not_available') }}

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

@foreach($item->details->where('type', 'attribute') as $detail)
{{ $detail->label }}
{{ $detail->value }}
@if($detail->image_path) {{ $detail->label }} @elseif($detail->cloth_attribute_id && $detail->attribute) @php $option = $detail->attribute->options->where('name', $detail->value)->first(); @endphp @if($option && $option->image_path) {{ $detail->label }} @endif @endif
@endforeach

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

@php $measurementDetails = $item->details->where('type', 'measurement'); if ($measurementDetails->isEmpty() && $item->measurement) { $measurementDetails = $item->measurement->items; } @endphp @foreach($measurementDetails as $detail)
{{ $detail->label ?? $detail->measureType?->title }}
{{ $detail->value }}
@endforeach
@endforeach @if($order->note)

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

{{ $order->note }}
@endif
@if($order->invoice && $order->invoice->due_amount > 0) @push('scripts') @endpush @endif @endsection