@extends('layouts.partials.master') @section('title', 'Editar Encomenda') @push('styles') @endpush @section('content')
| Nº Encomenda | Utilizador | Nr. Produtos | Código de desconto | Pontos Acumulados | 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 | @if ($order->points) {{ $order->points }} @else - @endif | @formatEuro($order->total) | {{ $order->updated_at }} | @include('layouts.components.status', [ 'status' => $order->status, ]) | Ver carrinho |
| Morada de faturação |
|---|
|
{{ $order->billing_address['recipient_first_name'] }} {{ $order->billing_address['recipient_last_name'] }} NIF: {{ $order->billing_address['fiscal_number'] ?? '-' }} {{ $order->billing_address['address_line1'] }} @if ($order->billing_address['address_line2']){{ $order->billing_address['address_line2'] }} @endif{{ $order->billing_address['postal_code'] }} @if ($order->billing_address['municipality']){{ $order->billing_address['municipality'] }} @endif{{ $order->billing_address['region']['name'] }} |
| Entrega | ||
|---|---|---|
| Entrega digital | ||
| Morada de entrega | ||
|
@php
$firstName = data_get($shippingAddress, 'recipient_first_name');
$lastName = data_get($shippingAddress, 'recipient_last_name');
@endphp
@if ($firstName || $lastName)
{{ trim(($firstName ?: '') . ' ' . ($lastName ?: '')) }} @endifNIF: {{ data_get($shippingAddress, 'fiscal_number') ?: '-' }} @if (data_get($shippingAddress, 'address_line1')){{ data_get($shippingAddress, 'address_line1') }} @endif @if (data_get($shippingAddress, 'address_line2')){{ data_get($shippingAddress, 'address_line2') }} @endif @if (data_get($shippingAddress, 'postal_code')){{ data_get($shippingAddress, 'postal_code') }} @endif @if (data_get($shippingAddress, 'municipality')){{ data_get($shippingAddress, 'municipality') }} @endif @if (data_get($shippingAddress, 'region.name')){{ data_get($shippingAddress, 'region.name') }} @endif |
||
| 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 => $group)
@if (!($group['has_physical_items'] ?? false))
@continue
@endif
@php
$store = $group['order_items']->first()->product->store;
$delivery = $order
->deliveries()
->where('store_id', $store->id)
->first();
@endphp
{{ $store->commercial_name }} {{ $store->address }} {{ $store->postal_code }} {{ $store->city }} {{ $store->country }} @include('layouts.components.status', [ 'status' => $delivery->status, ]) |
||
| ID | Nome | Morada |
| {{ $order->locker }} | @if ($order->locker_details) {{ $order->locker_details['name'] }} @else Erro ao obter dados do cacifo @endif |
@if ($order->locker_details)
@if ($order->locker_details['lockerDetails']['address'])
{{ $order->locker_details['lockerDetails']['address'] }} @endif @if ($order->locker_details['lockerDetails']['postalCodeCPC']) {{ $order->locker_details['lockerDetails']['postalCodeCPC'] }} @endif @if ($order->locker_details['locationInfo']) {{ $order->locker_details['locationInfo'] }} @endif @endif |
| Entrega digital |
Entregas
| ID | Loja | Reservas de Cacifo | Por reservar |
|---|---|---|---|
| {{ $delivery->id }} | {{ $store->commercial_name }} |
@foreach ($lockerReservations as $reservation)
{{ $reservation->reservation_number }} @foreach ($reservation->items as $reservedItem)- {{ $reservedItem->orderItem->quantity }} x {{ $reservedItem->orderItem->product_snapshot['name'] }}, {{ implode(', ', $reservedItem->orderItem->product_snapshot['attributes']) }} @endforeach @endforeach |
@php
$lockedOrderItemIds = $lockerReservations
->flatMap(fn($reservation) => $reservation->items)
->map(fn($item) => $item->order_item_id)
->values();
$availableOrderItems = $orderItems->reject(
fn($orderItem) => $lockedOrderItemIds->contains(
$orderItem->id,
),
);
@endphp
@foreach ($availableOrderItems as $item)
- {{ $item->quantity }} x {{ $item->product_snapshot['name'] }}, {{ implode(', ', $item->product_snapshot['attributes']) }} @endforeach |
| Loja | Guia de transporte | |
|---|---|---|
| {{ $group['order_items']->first()->product->store->commercial_name }} | @if ($group['shipping_label'] && Storage::disk('private')->exists($group['shipping_label'])) Ver guia @else Não gerada ainda @endif | @include('layouts.components.status', [ 'status' => $order->deliveries()->where('store_id', $storeId)->first()->status, ]) |
| Nome | @if ($order->paymentMethod->method === 'mbway')Número de Telemóvel | @elseif ($order->paymentMethod->method === 'multibanco')Entidade | Referência | Valor | @endifAções |
|---|---|---|---|---|---|
|
@if ($order->paymentMethod->image)
|
@if ($order->paymentMethod->method === 'mbway')
{{ $order->payment_phone_number }} | @elseif ($order->paymentMethod->method === 'multibanco')@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 | @endif
| Produto | Atributos | Quantidade | Preço | Ações | |
|---|---|---|---|---|---|
|
{{ $group['order_items']->first()->product->store->commercial_name }} Preço dos produtos: @formatEuro($group['order_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'])))
|
{{ $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 |
|
| Data | Ação | Montante | Comerciante |
|---|---|---|---|
| {{ $historyEntry['datetime'] }} | {{ $historyEntry['description'] }} | {{ $historyEntry['amount'] ?? '' }} | @if (array_key_exists('store', $historyEntry) && $historyEntry['store']) {{ $historyEntry['store']->commercial_name }} @endif |