Merge branch 'trunk'

This commit is contained in:
Vincent BRIDIER 2024-07-10 15:23:32 +02:00
commit c8b4f97c88
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
4 changed files with 30 additions and 29 deletions

View file

@ -182,7 +182,10 @@ class InvoiceController extends Controller
return $invoice->generateInvoice()
->stream(Str::slug(trans('Devis :appname :date - ref :ref', [
'appname' => config('app.name'),
'date' => $invoice->created_at->isoFormat('YYYY-MM-DD'),
'date' =>
$invoice->created_at !== $invoice->updated_at ?
$invoice->updated_at->isoFormat('YYYY-MM-DD') :
$invoice->created_at->isoFormat('YYYY-MM-DD'),
'ref' => $invoice->ref,
])) . '.pdf');
}
@ -202,7 +205,7 @@ class InvoiceController extends Controller
{
$model = $request->targetModel;
return DB::transaction(function () use ($model) {
$models = $model::orderBy('name', 'ASC')->paginate(12);
$models = $model::query()->orderBy('name', 'ASC')->paginate(12);
return \response()->json($models ?? 500);
});
}

View file

@ -192,30 +192,30 @@ class Invoice extends Model
'packages' => $packages,
],
[
'mode' => '',
'format' => 'A4',
'default_font_size' => '12',
'default_font' => 'sans-serif',
'margin_left' => 0,
'margin_right' => 0,
'margin_top' => 0,
'margin_bottom' => 0,
'margin_header' => 0,
'margin_footer' => 0,
'orientation' => 'P',
'title' => __('Devis Équipe Web :ref', ['ref' => $this->ref]),
'author' => 'Equipe Web',
'watermark' => '',
'show_watermark' => false,
'watermark_font' => 'sans-serif',
'display_mode' => 'fullpage',
'watermark_text_alpha' => 0.1,
'custom_font_dir' => '',
'mode' => '',
'format' => 'A4',
'default_font_size' => '12',
'default_font' => 'sans-serif',
'margin_left' => 0,
'margin_right' => 0,
'margin_top' => 0,
'margin_bottom' => 0,
'margin_header' => 0,
'margin_footer' => 0,
'orientation' => 'P',
'title' => __('Devis Équipe Web :ref', ['ref' => $this->ref]),
'author' => 'Equipe Web',
'watermark' => '',
'show_watermark' => false,
'watermark_font' => 'sans-serif',
'display_mode' => 'fullpage',
'watermark_text_alpha' => 0.1,
'custom_font_dir' => '',
'custom_font_data' => [],
'auto_language_detection' => false,
'temp_dir' => ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir(),
'pdfa' => false,
'pdfaauto' => false,
'auto_language_detection' => false,
'temp_dir' => ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir(),
'pdfa' => false,
'pdfaauto' => false,
]
);
return $pdf;

View file

@ -31,7 +31,6 @@
<th width="140">
{{ __("Montant") }}
</th>
<th />
</thead>
<tbody>
<template v-if="tasks.length">
@ -84,7 +83,6 @@
@change="updateAmount(index)"
type="number"
step="0.125"
min="0"
>
</td>
<td>

View file

@ -136,7 +136,7 @@
<tr>
<td class="with-bg" style="padding-left: 2mm;"><strong>{{ __('Tâches') }}</strong></td>
@if ($show_days)
<td class="with-bg" style="padding-left: 2mm;" width="22mm"><strong>{{ __('Jours') }}</strong></td>
<td class="with-bg" style="padding-left: 2mm;" width="22mm"><strong>{{ __('Qté') }}</strong></td>
@endif
<td class="with-bg" style="padding-left: 2mm;" width="22mm"><strong>{{ __('Montant') }}</strong></td>
</tr>
@ -181,7 +181,7 @@
<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', [
<strong>{{ __(':total', [
'total' => number_format($total_days, 2, ',', ''),
]) }}</strong>
</td>