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:
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