ldc-supportweb/resources/views/bo/pages/invoices/show.blade.php

118 lines
7.6 KiB
PHP

@extends('layout.app', ['brParam' => $invoiceModel])
@section('title', __('Aperçu d\'un :model', ['model' => __('models.classes.invoices')]))
@section('description', __('Aperçu d\'un :model déjà existant', ['model' => __('models.classes.invoices')]))
@section('breadcrumb', request()->route()->getName())
@section('content')
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
<div class="d-flex align-items-start flex-row">
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
href="{{ route('bo.invoices.index', ['status' => \App\Enums\Invoices\InvoiceStatusEnum::opened]) }}"
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.invoices')]) }}">
<i class="fa-solid fa-arrow-left"></i>
</a>
@include('breadcrumbs.breadcrumb-body', ['brParam' => $invoiceModel])
</div>
<div class="mb-md-0 mb-2">
<div class="btn-group" role="group">
<a class="btn btn-primary" data-bs-toggle="tooltip" data-bs-placement="top"
href="{{ route('bo.invoices.edit', ['invoice' => $invoiceModel->id]) }}"
title="{{ __('crud.helpers.update_model', ['model' => __('models.classes.invoices')]) }}">
<i class="fa-solid fa-pencil"></i>
</a>
</div>
</div>
</div>
<table class="table-hover table-borderless table">
<tbody>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.ref')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->ref }}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.firstname')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->firstname }}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.lastname')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->lastname }}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.object')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->object }}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.tasks')) }}</td>
<td class="py-0 pe-0 text-center align-middle">
<table class="table-hover table-borderless m-0 table">
<tbody>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ __('Commentaire') }}</td>
<td class="text-center align-middle">{{ __('Type') }}</td>
<td class="text-center align-middle">{{ __('Jours') }}</td>
<td class="text-center align-middle">{{ __('Montant') }}</td>
</tr>
@foreach ($invoiceModel->tasks as $task)
<tr class="@if (!$loop->last) border-bottom @endif list-item">
<td class="text-center align-middle">{!! nl2br($task['desc']) !!}</td>
<td class="text-center align-middle">{{ \App\Enums\Invoices\TaskTypeEnum::make($task['type'])->label() }}</td>
<td class="text-center align-middle">{{ $task['days'] }}</td>
<td class="text-center align-middle">{{ $task['amount'] }}€</td>
</tr>
@endforeach
</tbody>
</table>
</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.total')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->total }}€</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.total_days')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->total_days }}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.comment')) }}</td>
<td class="text-center align-middle">{!! clean($invoiceModel->comment) !!}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.show_days')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->show_days ? 'oui' : 'non' }}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.signed_date')) }}</td>
<td class="text-center align-middle"><span class="badge bg-info">{{ $invoiceModel->signed_date }}</span></td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.sent_client_date')) }}</td>
<td class="text-center align-middle"><span class="badge bg-info">{{ $invoiceModel->sent_client_date }}</span></td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.sent_accounting_date')) }}</td>
<td class="text-center align-middle"><span class="badge bg-info">{{ $invoiceModel->sent_accounting_date }}</span></td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.sites')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->site->name }}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.company_id')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->company->name }}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.invoiced_to_id')) }}</td>
<td class="text-center align-middle">{{ $invoiceModel->companyInvoiced->name }}</td>
</tr>
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.created_at')) }}</td>
<td class="text-center align-middle"><span class="badge bg-info">{{ $invoiceModel->created_at }}</span></td>
</tr>
<tr class="list-item">
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.updated_at')) }}</td>
<td class="text-center align-middle"><span class="badge bg-info">{{ $invoiceModel->updated_at }}</span></td>
</tr>
</tbody>
</table>
@endsection