Merge branch 'trunk'

This commit is contained in:
Noah Lancien 2024-11-25 17:12:45 +01:00
commit 17a01e1f7a
4 changed files with 31 additions and 23 deletions

View file

@ -86,12 +86,12 @@ class Invoice extends Model
->count() + 1) ?: 1, 4, '0'),
Str::substr(Str::upper(Str::slug(Auth::user()->name)), 0, 1)
);
$model->total_days = collect($model->tasks)
$model->total_days = collect([$model->tasks])
/** @var null|float $previous */
->reduce(function ($previous, array $task) {
return \floatval($task['days']) + \floatval($previous);
});
$model->total = collect($model->tasks)
$model->total = collect([$model->tasks])
/** @var null|float $previous */
->reduce(function ($previous, array $task) {
return \floatval($task['amount']) + \floatval($previous);
@ -99,12 +99,12 @@ class Invoice extends Model
$model->status = InvoiceStatusEnum::opened;
});
static::updating(function (self $model) {
$model->total_days = collect($model->tasks)
$model->total_days = collect([$model->tasks])
/** @var null|float $previous */
->reduce(function ($previous, array $task) {
return \floatval($task['days']) + \floatval($previous);
});
$model->total = collect($model->tasks)
$model->total = collect([$model->tasks])
/** @var null|float $previous */
->reduce(function ($previous, array $task) {
return \floatval($task['amount']) + \floatval($previous);

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -61,31 +61,46 @@
<div id="mainTable" cellpadding="0" cellspacing="0">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: right;padding-bottom: 3mm;" colspan="2"><b>{{ Str::upper($lastname) }} {{ $firstname }}</b>
<td rowspan="3">
<img src="{{ resource_path('assets/documents/invoice/logo_ldc.png') }}" alt="{{ trans('Logo LDC') }}"
style="width: 48mm;"/>
</td>
<td style="text-align: right;padding-bottom: 3mm;" colspan="2">
<b>{{ Str::upper($lastname) }} {{ $firstname }}</b>
</td>
</tr>
<tr>
<td style="text-align: right;padding-right: 3mm;"><b>{{ Str::singular(__('models.classes.companies')) }}</b></td>
<td style="white-space: nowrap;" width="auto">{{ $company->name }}</td>
<td style="text-align: right;padding-right: 3mm;">
<b>{{ Str::singular(__('models.classes.companies')) }}</b>
</td>
<td style="white-space: nowrap;" width="auto">
{{ $company->name }}
</td>
</tr>
<tr>
<td style="text-align: right;padding-right: 3mm;"><b>{{ __('Entité à facturer') }}</b></td>
<td style="white-space: nowrap;" width="auto">{{ $companyInvoiced->name }}</td>
</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
<table width="100%" cellspacing="0" cellpadding="0" style="margin-top: 25px;">
<tr>
<td style="height: 23mm;" valign="middle" width="12mm">
<img src="{{ resource_path('assets/documents/invoice/logo_ldc.jpg') }}" alt="{{ trans('Logo LDC') }}"
style="width: 12mm;" />
<td>
<span style="font-size: 16px;font-weight: bold;">{{ __('LDC Digital Groupe') }}</span>
</td>
<td width="50%">
<span style="font-size: 16px;font-weight: bold;">{{ __('SERVICE WEB MARKETING GROUPE') }}</span>
<td style="text-align: right;">
<span style="font-size: 16px;font-weight: bold;">{{ __('ESTIMATION / DEVIS') }}</span>
</td>
</tr>
<tr>
<td>
<span style="font-size: 16px;">{{ __('Société / LDC Services') }}</span>
</td>
</tr>
</table>
<br />
<table width="100%" cellspacing="0" cellpadding="0">
<div style="width: 60%;margin: 25px auto 25px auto;">
<img src="{{ resource_path('assets/documents/invoice/separator.png') }}" alt="separateur de contenu"/>
</div>
<table width="100%" cellspacing="0" cellpadding="0" style="margin-bottom: 25px;">
<tr>
<td width="25mm"><b>{{ __('Objet :') }}</b></td>
<td>{{ $object }}</td>
@ -103,13 +118,6 @@
<td><i>{{ Carbon\Carbon::parse($updated_at)->isoFormat('DD/MM/YYYY') }}</i></td>
</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: center;" height="26mm">
<span style="font-size: 16px;font-weight: bold;">{{ __('Prestation WEB') }}</span>
</td>
</tr>
</table>
@php
$tasks = collect($tasks);
@ -213,7 +221,7 @@
<table style="margin: auto;margin-bottom: 10mm;" width="90%" cellspacing="0" cellpadding="2">
<tr>
<td style="border-top:double medium #CCCCCC;padding-top: 2mm;" width="33%" valign="top">
{{ __('LDC Web Service') }}<br />
{{ __('LDC Digital Groupe') }}<br />
</td>
<td style="text-align: center;border-top:double medium #CCCCCC;padding-top: 2mm;" width="33%" valign="top">