feat: dashboard amélioré, exports budgets, alertes expiration et correctifs
## Dashboard - Refonte complète du tableau de bord avec widgets budgets, commandes, contrats - Intégration des données d'exécution budgétaire en temps réel ## Exports & Rapports - BudgetExecutionExport : export Excel de l'exécution budgétaire - Template PDF budgets (budgets_pdf.blade.php) - Routes d'export PDF et Excel ## Alertes & Notifications - Commande CheckExpirations : détection des contrats/assets arrivant à échéance - Mail ExpiringElementsMail avec template Blade - Planification via routes/console.php ## Correctifs - CommandePolicy et ContratPolicy : ajustements des règles d'autorisation - ContratController : corrections mineures - Commande model : ajustements relations/casts - AuthenticatedLayout : refonte navigation avec icônes budgets - Assets/Form.vue : corrections formulaire - Seeder rôles/permissions mis à jour - Dépendances composer mises à jour (barryvdh/laravel-dompdf, maatwebsite/excel) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
51
resources/views/emails/expiring_elements.blade.php
Normal file
51
resources/views/emails/expiring_elements.blade.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<x-mail::message>
|
||||
# Alerte d'échéance
|
||||
|
||||
Bonjour,
|
||||
|
||||
Ceci est un message automatique pour vous informer que les éléments suivants arrivent à échéance dans les **30 prochains jours**.
|
||||
|
||||
@if($contrats->isNotEmpty())
|
||||
## 📄 Contrats
|
||||
| Titre | Fournisseur | Échéance |
|
||||
| :--- | :--- | :--- |
|
||||
@foreach($contrats as $contrat)
|
||||
| {{ $contrat->titre }} | {{ $contrat->fournisseur?->nom ?? 'N/A' }} | {{ $contrat->date_echeance->format('d/m/Y') }} |
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if($licences->isNotEmpty())
|
||||
## 🔑 Licences
|
||||
| Nom | Fournisseur | Expiration |
|
||||
| :--- | :--- | :--- |
|
||||
@foreach($licences as $licence)
|
||||
| {{ $licence->nom }} | {{ $licence->fournisseur?->nom ?? 'N/A' }} | {{ $licence->date_expiration->format('d/m/Y') }} |
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if($assets->isNotEmpty())
|
||||
## 💻 Matériels (Garantie)
|
||||
| Nom | Modèle | Fin Garantie |
|
||||
| :--- | :--- | :--- |
|
||||
@foreach($assets as $asset)
|
||||
| {{ $asset->nom }} | {{ $asset->modele }} | {{ $asset->date_fin_garantie->format('d/m/Y') }} |
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if($domaines->isNotEmpty())
|
||||
## 🌐 Domaines
|
||||
| Nom | Prestataire | Échéance |
|
||||
| :--- | :--- | :--- |
|
||||
@foreach($domaines as $domaine)
|
||||
| {{ $domaine->nom }} | {{ $domaine->prestataire ?? 'N/A' }} | {{ $domaine->date_echeance->format('d/m/Y') }} |
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
|
||||
<x-mail::button :url="config('app.url')">
|
||||
Accéder au tableau de bord
|
||||
</x-mail::button>
|
||||
|
||||
<br>
|
||||
{{ config('app.name') }}
|
||||
</x-mail::message>
|
||||
85
resources/views/exports/budgets_pdf.blade.php
Normal file
85
resources/views/exports/budgets_pdf.blade.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Rapport Budgétaire {{ $annee }}</title>
|
||||
<style>
|
||||
body { font-family: 'Helvetica', sans-serif; font-size: 10px; color: #333; }
|
||||
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
|
||||
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
|
||||
th { bg-color: #f8fafc; font-weight: bold; }
|
||||
.header { text-align: center; margin-bottom: 20px; }
|
||||
.footer { position: fixed; bottom: 0; width: 100%; text-align: right; font-size: 8px; }
|
||||
.text-right { text-align: right; }
|
||||
.font-bold { font-weight: bold; }
|
||||
.bg-gray { background-color: #f1f5f9; }
|
||||
.title { font-size: 18px; font-bold; color: #1e293b; margin-bottom: 5px; }
|
||||
.subtitle { font-size: 12px; color: #64748b; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<div class="title">Rapport d'Exécution Budgétaire {{ $annee }}</div>
|
||||
<div class="subtitle">
|
||||
{{ $service }} | {{ $type }} | {{ $envelope }}
|
||||
<br>
|
||||
Généré le {{ date('d/m/Y H:i') }} par {{ $user->name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="bg-gray">
|
||||
<th>Budget / Ligne</th>
|
||||
<th>Service</th>
|
||||
<th>Type</th>
|
||||
<th class="text-right">Arbitré (€)</th>
|
||||
<th class="text-right">Consommé (€)</th>
|
||||
<th class="text-right">Engagé (€)</th>
|
||||
<th class="text-right">Total (€)</th>
|
||||
<th class="text-right">Reste (€)</th>
|
||||
<th class="text-right border-l">%</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($lignes as $lb)
|
||||
<tr>
|
||||
<td>
|
||||
<div class="font-bold">{{ $lb->nom }}</div>
|
||||
<div style="font-size: 8px; color: #64748b;">{{ ucfirst($lb->type_depense) }}</div>
|
||||
</td>
|
||||
<td>{{ $lb->budget->service->nom ?? 'Agglo' }}</td>
|
||||
<td>{{ $lb->budget->type_budget === 'agglo' ? 'Agglomération' : 'Mutualisé' }}</td>
|
||||
<td class="text-right">{{ number_format($lb->montant_arbitre, 2, ',', ' ') }}</td>
|
||||
<td class="text-right">{{ number_format($lb->consomme, 2, ',', ' ') }}</td>
|
||||
<td class="text-right">{{ number_format($lb->engage, 2, ',', ' ') }}</td>
|
||||
<td class="text-right font-bold">{{ number_format($lb->total_cumule, 2, ',', ' ') }}</td>
|
||||
<td class="text-right" style="color: {{ $lb->reste < 0 ? '#e11d48' : '#334155' }};">
|
||||
{{ number_format($lb->reste, 2, ',', ' ') }}
|
||||
</td>
|
||||
<td class="text-right font-bold">
|
||||
{{ $lb->montant_arbitre > 0 ? round(($lb->total_cumule / $lb->montant_arbitre) * 100, 1) : 0 }}%
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="bg-gray">
|
||||
<td colspan="3" class="font-bold">TOTAL GÉNÉRAL</td>
|
||||
<td class="text-right font-bold">{{ number_format($lignes->sum('montant_arbitre'), 2, ',', ' ') }} €</td>
|
||||
<td class="text-right font-bold">{{ number_format($lignes->sum('consomme'), 2, ',', ' ') }} €</td>
|
||||
<td class="text-right font-bold">{{ number_format($lignes->sum('engage'), 2, ',', ' ') }} €</td>
|
||||
<td class="text-right font-bold">{{ number_format($lignes->sum('total_cumule'), 2, ',', ' ') }} €</td>
|
||||
<td class="text-right font-bold">{{ number_format($lignes->sum('montant_arbitre') - $lignes->sum('total_cumule'), 2, ',', ' ') }} €</td>
|
||||
<td class="text-right font-bold">
|
||||
{{ $lignes->sum('montant_arbitre') > 0 ? round(($lignes->sum('total_cumule') / $lignes->sum('montant_arbitre')) * 100, 1) : 0 }}%
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<div class="footer">
|
||||
DSI-Commander - Système de gestion budgétaire - Page 1/1
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user