ldc-boutique-cnc-sable/resources/views/bo/orders/view.blade.php
Jérémy Munsch bf3e7a93fd
refactor(i18n): harmonize translation keys to English and complete French translations
- Convert hardcoded strings and French translation keys to English keys across Blade templates, Vue components, TypeScript modules, models, and routes
- Complete and synchronize lang/fr.json and lang/en.json translation dictionaries
- Add timezone attribute in lang/fr/validation.php and lang/en/validation.php
- Add missing English lang files for parity: crud.php, models.php, search.php, and vue.php
2026-10-27 09:58:47 +01:00

183 lines
8 KiB
PHP

@extends('bo.layouts.layout')
@section('title', sprintf('%s - %s %s', Str::ucfirst(__('crud.actions.edit')), Str::ucfirst(trans_choice('models.classes.orders', 1)),
$order->reference))
@section('breadcrumb', request()->route()->getName())
@php view()->share('brParam', $order) @endphp
@section('content')
<div class="card">
<div class="card-header">
<div class="row">
<div class="col">
<h1 class="h3">
<a class="btn btn-sm btn-primary" href="{{ route('bo.orders.index') }}"><i class="fa-solid fa-arrow-left"></i></a>
{{ Str::ucfirst(trans_choice('models.classes.orders', 1)) }}&nbsp;-&nbsp;{{ $order->reference }}
</h1>
</div>
<div class="col-3 text-end">
<div class="btn-group">
@can('forward', $order)
<a class="btn btn-primary" class="d-inline" href="{{ route('bo.orders.forward', $order) }}"
title="{{ __('Proceed to the next step') }}">
<i class="fa-solid fa-forward"></i>
<span>{{ Str::title($order->status->label()) }}</span>
</a>
@endcan
@can('cancel', $order)
<form class="d-inline confirmCancelJS" action="{{ route('bo.orders.cancel', $order) }}" method="POST">
@csrf
<button class="btn btn-sm btn-danger" title="{{ __('Cancel the order') }}">
<i class="fa-solid fa-times"></i></button>
</form>
@endcan
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="row mb-4">
{{-- EMPLOYEE --}}
<div class="col-lg-4 p-3">
<div class="border-primary-subtle rounded border p-2 shadow-sm">
<h2 class="h4">{{ str::title(trans_choice('models.classes.customers', 1)) }}</h2>
<address class="mx-2">
<h3 class="h5">{{ __('Order data') }}</h3>
<p class="mb-2">{{ Str::title($employee->firstname) }} {{ Str::title($employee->lastname) }}</p>
<p class="mb-2">
<span class="d-flex mw-10">
<strong class="d-inline-block">{{ __('Facility') }}</strong>
<span class="d-inline-block ms-auto"> {{ $employee->facility }}</span>
</span>
<span class="d-flex mw-10">
<strong class="d-inline-block">{{ __('Service') }}</strong>
<span class="d-inline-block ms-auto"> {{ $employee->service }}</span>
</span>
<span class="d-flex mw-10">
<strong class="d-inline-block">{{ __('Site') }}</strong>
<span class="d-inline-block ms-auto"> {{ $employee->site }}</span>
</span>
</p>
@if (!empty($crmCustomer))
<hr>
<h3 class="h5">{{ __('CRM data') }}</h3>
<p>
<a class="d-block" href="mailto:{{ $crmCustomer->email }}">{{ $crmCustomer->email }}</a>
@if ($crmCustomer->phone)
<a class="d-block" href="tel:{{ $crmCustomer->phone }}">{{ $crmCustomer->phone }}</a>
@endif
</p>
<p>
<span class="d-block">{{ $crmCustomer->address }}</span>
@if ($crmCustomer->address2)
<span class="d-block">{{ $crmCustomer->address2 }}</span>
@endif
<span>{{ $crmCustomer->postcode }}</span>
<span>{{ $crmCustomer->city }}</span>
</p>
@endif
</address>
</div>
</div>
{{-- ORDER --}}
<div class="col-lg-4 p-3">
<div class="border-info-subtle rounded border p-2 shadow-sm">
<h2 class="h4">{{ __('Order details') }}</h2>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<strong>{{ Str::ucfirst(__('validation.custom.attributes.reference')) }}</strong>
<span class="d-block">{{ $order->reference }}</span>
</li>
<li class="list-group-item">
<strong>{{ Str::ucfirst(__('validation.custom.attributes.order_date')) }}</strong>
<span class="d-block">{{ Date::forHumans($order->created_at) }}</span>
</li>
<li class="list-group-item">
<strong>{{ Str::ucfirst(__('validation.custom.attributes.order_status')) }}</strong>
<span class="d-block">{{ Str::ucfirst($order->status->label()) }}</span>
</li>
<li class="list-group-item">
<strong>{{ Str::ucfirst(__('validation.custom.attributes.total')) }}</strong>
<span class="d-block">@money($order->total)</span>
</li>
</ul>
</div>
</div>
{{-- SHOP --}}
<div class="col-lg-4 p-3">
<div class="border-info-subtle rounded border p-2 shadow-sm">
<h2 class="h4 d-inline-block">{{ trans_choice('Pickup Locations', 1) }}</h2>
@can('update', $shop)
<a class="btn btn-sm btn-primary float-end" href="{{ route('bo.shops.edit', $shop) }}"
title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a>
@endcan
<address class="mx-2">
<p class="mb-2">{{ $shop->name }}</p>
<p>
@if ($shop->phone)
<a class="d-block" href="tel:{{ $shop->phone }}">{{ $shop->phone }}</a>
@endif
</p>
<p>
<span class="d-block">{{ $shop->address }}</span>
<span>{{ $shop->postcode }}</span>
<span>{{ $shop->city }}</span>
<a class="d-block my-2" data-bs-toggle="tooltip"
href="https://www.openstreetmap.org/#map=18/{{ $shop->latitude }}/{{ $shop->longitude }}"
title="{{ __('View on OpenStreetMap') }}" target="__blank">
<span>{{ $shop->latitude }}</span>
<span>{{ $shop->longitude }}</span>
</a>
</p>
</address>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="table-responsive">
<table class="table">
<thead>
<th scope="col">{{ Str::ucfirst(__('validation.custom.attributes.reference')) }}</th>
<th scope="col">{{ Str::ucfirst(trans_choice('models.classes.products', 1)) }}</th>
<th scope="col">{{ Str::ucfirst(__('validation.attributes.quantity')) }}</th>
<th scope="col">{{ __('Unit price (excluding tax)') }}</th>
<th scope="col">{{ __('Discounted unit price (excluding tax)') }}</th>
<th scope="col">{{ __('Total Price (excluding tax)') }}</th>
<th scope="col">{{ __('VAT') }}</th>
<th scope="col">{{ __('Total (including tax)') }}</th>
<th></th>
</thead>
<tbody>
@foreach ($order->lines as $line)
<tr>
<td>{{ $line->product->incoId->value }}</td>
<td>
<span class="d-block">{{ $line->product->name }}</span>
<span class="d-block fst-italic">{{ $line->product->brand->label() }}</span>
<span class="d-block d-none">@money($line->product->discountedPrice ?? $line->product->price)</span>
</td>
<td>{{ $line->quantity }}</td>
<td>@money($line->unit_price)</td>
<td>@money($line->unitPriceDiscountedHt)</td>
<td>@money($line->total_ht)</td>
<td>@money($line->total_tax)</td>
<td>@money($line->total_ttc)</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection