Closes #45 Allow update comment on invoice

This commit is contained in:
Jérémy Munsch 2023-10-12 16:30:43 +02:00
parent 4cbce831a0
commit e3fddc1593
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
3 changed files with 19 additions and 18 deletions

View file

@ -21,6 +21,7 @@ class UpdateInvoiceRequest extends StoreInvoiceRequest
$rules = array_merge($rules, parent::rules());
}
$rules = array_merge($rules, [
'comment' => 'sometimes|nullable|string|min:15',
'sent_client_date' => 'required_with:signed_date,sent_accounting_date|sometimes|nullable|date',
'signed_date' => 'required_with:sent_accounting_date|sometimes|nullable|date',
'sent_accounting_date' => 'sometimes|nullable|date',

View file

@ -8,7 +8,7 @@
@if($invoiceModel->status !== \App\Enums\Invoices\InvoiceStatusEnum::opened)
{{ __('Impossible de mettre à jour les informations d\'un devis :status.', ['status' => $invoiceModel->status->label()]) }}
@elseif($invoiceModel->signed_date)
{{ __('Impossible de mettre à jour les informations d\'un devis déjà signé, seule la section "État" est prise en compte') }}
{{ __('Impossible de mettre à jour les informations d\'un devis déjà signé, seule les sections "État" et "Commentaires" sont pris en compte') }}
@endif
</strong>
</div>
@ -215,8 +215,6 @@
<div class="row mb-3">
<div class="col-12">
@if($invoiceModel->sent_client_date)
<textarea class="form-control" disabled>{{ $invoiceModel->comment }}</textarea>
@else
@include('bo.partials.inputs.text-html', [
'id' => 'invoiceComment',
'label' => __('Commentaire du :model', [
@ -229,6 +227,8 @@
'number' => 15
]),
])
@else
<textarea class="form-control" disabled>{{ $invoiceModel->comment }}</textarea>
@endif
</div>
</div>

View file

@ -13,12 +13,12 @@
<meta name="csrf-token" content="{{ csrf_token() }}">
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#0040a6">
<link href="/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180">
<link type="image/png" href="/favicon-32x32.png" rel="icon" sizes="32x32">
<link type="image/png" href="/android-chrome-192x192.png" rel="icon" sizes="192x192">
<link type="image/png" href="/favicon-16x16.png" rel="icon" sizes="16x16">
<link href="/site.webmanifest" rel="manifest">
<link href="/safari-pinned-tab.svg" rel="mask-icon" color="#0040a6">
<meta name="apple-mobile-web-app-title" content="Support">
<meta name="application-name" content="Support">
<meta name="msapplication-TileColor" content="#4c272c">
@ -32,17 +32,17 @@
<body class="position-relative min-vh-100">
@include('layout.nav')
<div id="app" class="content mt-5">
<div class="container container-xxl">
<div class="content mt-5" id="app">
<div class="container-xxl container">
<div class="row justify-content-center">
<div class="col-12 @yield('bodyClass')">
@auth
@foreach ($informations as $information)
<div class="alert alert-{{ $information->type->class() }}" role="alert">
<b>{{ $information->title }}</b><br>
{{ $information->message }} - {{ __('Publié le') }} {{ $information->created_at->format('d-m-Y') }}
</div>
@endforeach
@foreach ($informations as $information)
<div class="alert alert-{{ $information->type->class() }}" role="alert">
<b>{{ $information->title }}</b><br>
{{ $information->message }} - {{ __('Publié le') }} {{ $information->created_at->format('d-m-Y') }}
</div>
@endforeach
@endauth
@include('modules.flash-messages')
@ -54,7 +54,7 @@
@include('layout.footer')
@stack('scriptsConstants')
@include('modules.script-constants')
@vite(['resources/ts/bo.ts'])
@vite(['resources/ts/bo/bo.ts'])
@stack('scripts')
</body>