@extends('layouts.partials.master') @section('title', 'Editar Encomenda') @push('styles') @endpush @section('content')
@include('layouts.components.section-title', ['title' => 'Editar Encomenda']) Voltar
@include('layouts.components.alerts')
Nº Encomenda Utilizador Nr. Produtos Código de desconto Total Data de Atualização Estado Carrinho
{{ $order->order_code }} @if ($order->userDetails && !$order->userDetails->trashed()) {{ $order->user->full_name }} @else {{ $order->user->full_name }} (excluído) @endif {{ $order->nProducts }} @if ($order->promo_code) {{ $order->promo_code }} @else - @endif @formatEuro($order->total) {{ $order->updated_at }} @include('layouts.components.status', ['status' => $order->status]) Ver carrinho
@include('layouts.components.section-marker', ['section_name' => 'Faturação', 'mt' => 'mt-3'])
Morada de faturação

{{ $order->billing_address }}

@include('layouts.components.section-marker', ['section_name' => 'Entrega', 'mt' => 'mt-3'])
@if($order->shipping_address) @elseif($order->pickup_spot) @elseif($order->at_store_pickup) @endif
Morada
{{ $order->shipping_address }}
ID Nome Morada
{{ $order->pickup_spot }} {{ $order->pickup_spot_details['name'] }} @if ($order->pickup_spot_details['addressLine1']) {{ $order->pickup_spot_details['addressLine1'] }}
@endif @if ($order->pickup_spot_details['addressLine2']) {{ $order->pickup_spot_details['addressLine2'] }}
@endif @if ($order->pickup_spot_details['streetNumber']) {{ $order->pickup_spot_details['streetNumber'] }}
@endif @if ($order->pickup_spot_details['postalCode'] || $order->pickup_spot_details['city']) {{ $order->pickup_spot_details['postalCode'] }} {{ $order->pickup_spot_details['city'] }} @endif
Levantamento em Loja
@foreach($itemsGroupedByStore as $storeId => $items) @php $store = $items->first()->product->store; @endphp

{{ $store->commercial_name }}

{{ $store->address }}

{{ $store->postal_code }} {{ $store->city }}

{{ $store->country }}

@endforeach
@if($order->pickup_spot) @include('layouts.components.section-marker', ['section_name' => 'Transporte', 'mt' => 'mt-3'])
@foreach($itemsGroupedByStore as $storeId => $items) @endforeach
Loja Guia de transporte
{{ $items->first()->product->store->commercial_name }} @if (Arr::get($order->shipping_labels, $storeId) && Storage::disk('private')->exists($order->shipping_labels[$storeId])) Ver guia @else Não gerada ainda @endif
@endif @include('layouts.components.section-marker', ['section_name' => 'Pagamento', 'mt' => 'mt-3'])
@if ($order->paymentMethod->method === 'mbway') @elseif ($order->paymentMethod->method === 'multibanco') @endif @if ($order->paymentMethod->method === 'mbway') @elseif ($order->paymentMethod->method === 'multibanco') @endif
NomeNúmero de TelemóvelEntidade Referência ValorAções
@if ($order->paymentMethod->image) Imagem @endif {{ $order->paymentMethod->name }} {{ $order->payment_phone_number }} @if (is_array($order->paymentTransaction->payment->creation_response) && $order->paymentTransaction->payment->creation_response['method']) {{ $order->paymentTransaction->payment->creation_response['method']['entity'] }} @endif @if (is_array($order->paymentTransaction->payment->creation_response) && $order->paymentTransaction->payment->creation_response['method']) @formatMbReference($order->paymentTransaction->payment->creation_response['method']['reference']) @endif @if($order->paymentTransaction->currency === 'EUR') @formatEuro($order->paymentTransaction->amount) @else {{ $order->paymentTransaction->amount }} {{ $order->paymentTransaction->currency }} @endif
@include('layouts.components.section-marker', ['section_name' => 'Produtos', 'mt' => 'mt-3'])
@foreach($itemsGroupedByStore as $storeId => $items) @foreach($items as $item) @endforeach @endforeach
Produto Atributos Quantidade Preço Ações

{{ $items->first()->product->store->commercial_name }}

Preço dos produtos: @formatEuro($items->sum(fn($item) => $item->quantity * $item->unit_price))

@if ($order->discounts_per_store)

Desconto aplicado pelo código {{ $order->promo_code }}: @formatEuro($order->discounts_per_store[$storeId])

@endif @if ($order->total_paid_per_store)

Total a receber pelo comerciante: @formatEuro($order->total_paid_per_store[$storeId])

@endif
@if (file_exists(public_path('storage/' . $item->product_snapshot['image']))) Imagem do Produto @endif {{ $item->product_snapshot['name'] }} @foreach($item->product_snapshot['attributes'] as $attributeValue)

{{ $attributeValue }}

@endforeach
{{ $item->quantity }} @formatEuro($item->quantity * $item->unit_price)
por unidade: @formatEuro($item->unit_price) @if($item->unit_price !== $item->unit_full_price) @formatEuro($item->unit_full_price) @endif
@include('layouts.components.section-marker', ['section_name' => 'Histórico', 'mt' => 'mt-3'])
@foreach($history as $historyEntry) @endforeach
Data Ação Montante Comerciante
{{ $historyEntry['datetime'] }} {{ $historyEntry['description'] }} {{ $historyEntry['amount'] ?? '' }} @if(array_key_exists('store', $historyEntry) && $historyEntry['store']) {{ $historyEntry['store']->commercial_name }} @endif
@endsection