Fix Facture to Devis
This commit is contained in:
parent
8b637f7b13
commit
c0fe0dd959
4 changed files with 45 additions and 43 deletions
|
|
@ -144,8 +144,7 @@ class InvoiceController extends Controller
|
|||
public function updateModel(Invoice &$model)
|
||||
{
|
||||
if ($model->signed_date) {
|
||||
throw ValidationException::withMessages([
|
||||
'erreur' => trans('Il n\'est pas possible de mettre a jour une facture qui est signée')
|
||||
throw ValidationException::withMessages(['erreur' => trans('Il n\'est pas possible de mettre a jour un devis qui est signé')
|
||||
]);
|
||||
}
|
||||
$this->validateTasks($model);
|
||||
|
|
@ -214,7 +213,7 @@ class InvoiceController extends Controller
|
|||
{
|
||||
$this->authorize($invoice, 'download');
|
||||
return $invoice->generateInvoice()
|
||||
->stream(Str::slug(trans('Facture :appname :date - ref :ref', [
|
||||
->stream(Str::slug(trans('Devis :appname :date - ref :ref', [
|
||||
'appname' => config('app.name'),
|
||||
'date' => $invoice->created_at->isoFormat('YYYY-MM-DD'),
|
||||
'ref' => $invoice->ref,
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ class Invoice extends Model
|
|||
'margin_header' => 0,
|
||||
'margin_footer' => 0,
|
||||
'orientation' => 'P',
|
||||
'title' => __('Facture Service Web :ref', ['ref' => $this->ref]),
|
||||
'title' => __('Devis Équipe Web :ref', ['ref' => $this->ref]),
|
||||
'author' => 'Equipe Web',
|
||||
'watermark' => '',
|
||||
'show_watermark' => false,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ return [
|
|||
'brands' => 'Marques',
|
||||
'labels' => 'Labels',
|
||||
'packages' => 'Forfaits',
|
||||
'invoices' => 'Factures',
|
||||
'invoices' => 'Devis',
|
||||
'companies' => 'Sociétés',
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
<head>
|
||||
<title>
|
||||
{{ __('Facture :appname - ref :ref', [
|
||||
{{ __('Devis :appname - ref :ref', [
|
||||
'appname' => config('app.name'),
|
||||
'ref' => $ref,
|
||||
]) }}
|
||||
</title>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
|
||||
<style type="text/css">
|
||||
html,
|
||||
|
|
@ -46,6 +46,7 @@
|
|||
border: 1px solid;
|
||||
border-color: #CCC;
|
||||
}
|
||||
|
||||
.with-bg {
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
|
|
@ -74,14 +75,14 @@
|
|||
<table width="100%" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td valign="middle" width="12mm" style="height: 23mm;">
|
||||
<img style="width: 12mm;" src="{{ resource_path('assets/documents/invoice/logo_ldc.jpg') }}" alt="{{ trans('Logo LDC') }}"/>
|
||||
<img style="width: 12mm;" src="{{ resource_path('assets/documents/invoice/logo_ldc.jpg') }}" alt="{{ trans('Logo LDC') }}" />
|
||||
</td>
|
||||
<td width="50%">
|
||||
<span style="font-size: 16px;font-weight: bold;">{{ __('SERVICE WEB MARKETING GROUPE') }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<br />
|
||||
<table width="100%" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="25mm"><b>{{ __('Objet :') }}</b></td>
|
||||
|
|
@ -109,11 +110,11 @@
|
|||
</table>
|
||||
|
||||
@php
|
||||
$tasks = collect($tasks);
|
||||
$columns = 2 + ( $show_days ? 1 : 0);
|
||||
$page = 1;
|
||||
$perPage = 8;
|
||||
$lastPage = App\Lib\CollectionHelper::paginateManually($tasks, $perPage)->lastPage();
|
||||
$tasks = collect($tasks);
|
||||
$columns = 2 + ( $show_days ? 1 : 0);
|
||||
$page = 1;
|
||||
$perPage = 8;
|
||||
$lastPage = App\Lib\CollectionHelper::paginateManually($tasks, $perPage)->lastPage();
|
||||
@endphp
|
||||
|
||||
@while($lastPage >= $page)
|
||||
|
|
@ -127,7 +128,7 @@
|
|||
</table>
|
||||
@endif
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="2" class="bordered" @if($page !== 1) style="margin-top: 30mm;" @endif>
|
||||
<table width="100%" cellspacing="0" cellpadding="2" class="bordered" @if($page !==1) style="margin-top: 30mm;" @endif>
|
||||
@if($page === 1)
|
||||
<tr>
|
||||
<td class="with-bg" style="padding-left: 2mm;"><strong>{{ __('Tâches') }}</strong></td>
|
||||
|
|
@ -136,7 +137,9 @@
|
|||
@endif
|
||||
<td width="22mm" class="with-bg" style="padding-left: 2mm;"><strong>{{ __('Montant') }}</strong></td>
|
||||
</tr>
|
||||
<tr style="display:none;"><td colspan="{{ $columns }}"></td></tr>
|
||||
<tr style="display:none;">
|
||||
<td colspan="{{ $columns }}"></td>
|
||||
</tr>
|
||||
@endif
|
||||
@foreach($taskList as $task)
|
||||
<tr>
|
||||
|
|
@ -166,36 +169,36 @@
|
|||
|
||||
@php $page++; @endphp
|
||||
@if($taskList->currentPage() < $taskList->lastPage())
|
||||
<pagebreak>
|
||||
@endif
|
||||
@endwhile
|
||||
<pagebreak>
|
||||
@endif
|
||||
@endwhile
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="2" class="bordered">
|
||||
<tr>
|
||||
<td style="padding-left: 2mm;"><span style="font-size: 14px;font-weight: bold;">{{ __('Total') }}</span></td>
|
||||
@if($show_days)
|
||||
<td width="22mm" align="center"><strong>{{ __(':total Jours', [
|
||||
<table width="100%" cellspacing="0" cellpadding="2" class="bordered">
|
||||
<tr>
|
||||
<td style="padding-left: 2mm;"><span style="font-size: 14px;font-weight: bold;">{{ __('Total') }}</span></td>
|
||||
@if($show_days)
|
||||
<td width="22mm" align="center"><strong>{{ __(':total Jours', [
|
||||
'total' => number_format($total_days, 2, ',', '')
|
||||
]) }}</strong></td>
|
||||
@endif
|
||||
<td width="22mm" align="center"><strong>{{ __(':total €', [
|
||||
@endif
|
||||
<td width="22mm" align="center"><strong>{{ __(':total €', [
|
||||
'total' => number_format($total, 2, ',', '')
|
||||
]) }}</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
@if($comment)
|
||||
<br>
|
||||
<div>
|
||||
<span style="font-size: 13px;font-weight: bold;">{{ __('Commentaire') }}</span>
|
||||
</div>
|
||||
<table width="100%" cellspacing="0" cellpadding="2" class="bordered">
|
||||
<tr>
|
||||
<td style="padding: 2mm;">
|
||||
{{ Str::limit($comment, 2100) }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@if($comment)
|
||||
<br>
|
||||
<div>
|
||||
<span style="font-size: 13px;font-weight: bold;">{{ __('Commentaire') }}</span>
|
||||
</div>
|
||||
<table width="100%" cellspacing="0" cellpadding="2" class="bordered">
|
||||
<tr>
|
||||
<td style="padding: 2mm;">
|
||||
{{ Str::limit($comment, 2100) }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -203,7 +206,7 @@
|
|||
<table width="90%" cellspacing="0" cellpadding="2" style="margin: auto;margin-bottom: 10mm;">
|
||||
<tr>
|
||||
<td width="33%" style="border-top:double medium #CCCCCC;padding-top: 2mm;" valign="top">
|
||||
{{ __("LDC Web Service") }}<br/>
|
||||
{{ __("LDC Web Service") }}<br />
|
||||
</td>
|
||||
<td width="33%" style="text-align: center;border-top:double medium #CCCCCC;padding-top: 2mm;" valign="top">
|
||||
|
||||
|
|
@ -216,4 +219,4 @@
|
|||
</htmlpagefooter>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
Loading…
Add table
Reference in a new issue