-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrapports.html
More file actions
515 lines (465 loc) · 24.8 KB
/
Copy pathrapports.html
File metadata and controls
515 lines (465 loc) · 24.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rapports - Amicale Universitaire</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.3/echarts.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Source+Sans+Pro:wght@300;400;600&display=swap" rel="stylesheet">
<style>
body { font-family: 'Source Sans Pro', sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family: 'Inter', sans-serif; }
.card-shadow { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); }
.chart-container { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); }
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Navigation -->
<nav class="bg-white shadow-lg">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center">
<img src="resources/logo-amicale.png" alt="Logo Amicale" class="h-8 w-auto">
<span class="ml-3 text-xl font-bold text-blue-900">Amicale Universitaire</span>
</div>
</div>
<div class="flex items-center space-x-8">
<a href="index.html" class="text-gray-600 hover:text-blue-900 transition-colors">Tableau de Bord</a>
<a href="transactions.html" class="text-gray-600 hover:text-blue-900 transition-colors">Transactions</a>
<a href="membres.html" class="text-gray-600 hover:text-blue-900 transition-colors">Membres</a>
<a href="demandes.html" class="text-gray-600 hover:text-blue-900 transition-colors">Demandes</a>
<a href="rapports.html" class="text-blue-900 font-semibold border-b-2 border-blue-900 pb-1">Rapports</a>
<a href="administration.html" class="text-gray-600 hover:text-blue-900 transition-colors">Administration</a>
<a href="parametres.html" class="text-gray-600 hover:text-blue-900 transition-colors">Paramètres</a>
</div>
</div>
</div>
</nav>
<!-- Header -->
<div class="bg-white border-b border-gray-200">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="flex justify-between items-center">
<div>
<h1 class="text-3xl font-bold text-gray-900">Rapports et Analyses</h1>
<p class="mt-2 text-gray-600">Analyses détaillées et prévisions financières de l'association</p>
</div>
<div class="flex space-x-3">
<button onclick="exporterPDF()" class="bg-red-600 hover:bg-red-700 text-white font-semibold py-2 px-4 rounded-lg transition-colors">
<svg class="w-4 h-4 inline-block mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
Exporter PDF
</button>
<button onclick="exporterCSV()" class="bg-green-600 hover:bg-green-700 text-white font-semibold py-2 px-4 rounded-lg transition-colors">
<svg class="w-4 h-4 inline-block mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17v-2m3 2v-4m3 4v-6m2 10H7a4 4 0 01-4-4V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
Exporter CSV
</button>
</div>
</div>
</div>
</div>
<!-- Période de rapport -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
<div class="bg-white rounded-lg card-shadow p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Période du rapport</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div>
<label for="periodeRapport" class="block text-sm font-medium text-gray-700 mb-2">Type de période</label>
<select id="periodeRapport" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="mensuel">Mensuel</option>
<option value="trimestriel">Trimestriel</option>
<option value="annuel">Annuel</option>
<option value="personnalise">Personnalisé</option>
</select>
</div>
<div>
<label for="dateDebutRapport" class="block text-sm font-medium text-gray-700 mb-2">Date de début</label>
<input type="date" id="dateDebutRapport" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label for="dateFinRapport" class="block text-sm font-medium text-gray-700 mb-2">Date de fin</label>
<input type="date" id="dateFinRapport" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div class="mt-4 flex justify-end">
<button onclick="genererRapport()" class="bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded-lg transition-colors">
Générer le rapport
</button>
</div>
</div>
</div>
<!-- Résumé financier -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-6">
<div class="bg-white rounded-lg card-shadow p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Résumé Financier</h3>
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
<div class="text-center">
<div class="text-3xl font-bold text-blue-600" id="soldePeriode">€0.00</div>
<div class="text-sm text-gray-500 mt-1">Solde de la période</div>
</div>
<div class="text-center">
<div class="text-3xl font-bold text-green-600" id="totalEntreesPeriode">€0.00</div>
<div class="text-sm text-gray-500 mt-1">Total entrées</div>
</div>
<div class="text-center">
<div class="text-3xl font-bold text-red-600" id="totalSortiesPeriode">€0.00</div>
<div class="text-sm text-gray-500 mt-1">Total sorties</div>
</div>
<div class="text-center">
<div class="text-3xl font-bold text-purple-600" id="tauxCroissance">0%</div>
<div class="text-sm text-gray-500 mt-1">Taux de croissance</div>
</div>
</div>
</div>
</div>
<!-- Graphiques avancés -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-6">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<!-- Évolution mensuelle -->
<div class="chart-container rounded-lg card-shadow p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Évolution Mensuelle</h3>
<div id="graphiqueEvolutionMensuelle" style="height: 300px;"></div>
</div>
<!-- Répartition par catégorie -->
<div class="chart-container rounded-lg card-shadow p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Répartition par Catégorie</h3>
<div id="graphiqueRepartitionCategories" style="height: 300px;"></div>
</div>
</div>
</div>
<!-- Analyse des tendances -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-6">
<div class="bg-white rounded-lg card-shadow p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Analyse des Tendances</h3>
<div id="graphiqueTendances" style="height: 400px;"></div>
</div>
</div>
<!-- Prévisions -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-6">
<div class="bg-white rounded-lg card-shadow p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Prévisions Financières</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div class="bg-blue-50 p-4 rounded-lg">
<h4 class="font-semibold text-blue-900 mb-2">Prochain mois</h4>
<p class="text-2xl font-bold text-blue-600" id="previsionMois">€0.00</p>
<p class="text-sm text-blue-700 mt-1">Basé sur les tendances actuelles</p>
</div>
<div class="bg-green-50 p-4 rounded-lg">
<h4 class="font-semibold text-green-900 mb-2">Prochain trimestre</h4>
<p class="text-2xl font-bold text-green-600" id="previsionTrimestre">€0.00</p>
<p class="text-sm text-green-700 mt-1">Projection sur 3 mois</p>
</div>
<div class="bg-purple-50 p-4 rounded-lg">
<h4 class="font-semibold text-purple-900 mb-2">Prochaine année</h4>
<p class="text-2xl font-bold text-purple-600" id="previsionAnnee">€0.00</p>
<p class="text-sm text-purple-700 mt-1">Projection annuelle</p>
</div>
</div>
<div id="graphiquePrevisions" style="height: 300px;"></div>
</div>
</div>
<!-- Recommandations -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-12">
<div class="bg-white rounded-lg card-shadow">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-semibold text-gray-900">Recommandations</h3>
<p class="text-sm text-gray-500">Conseils basés sur l'analyse des données</p>
</div>
<div class="p-6">
<div class="space-y-4">
<div class="flex items-start p-4 bg-blue-50 rounded-lg">
<div class="flex-shrink-0">
<svg class="w-5 h-5 text-blue-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"></path>
</svg>
</div>
<div class="ml-3">
<h4 class="text-sm font-medium text-blue-800">Optimisation des dépenses</h4>
<p class="text-sm text-blue-700 mt-1">Les dépenses en matériel représentent 45% du budget. Envisagez de planifier ces achats sur plusieurs mois pour lisser les dépenses.</p>
</div>
</div>
<div class="flex items-start p-4 bg-green-50 rounded-lg">
<div class="flex-shrink-0">
<svg class="w-5 h-5 text-green-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path>
</svg>
</div>
<div class="ml-3">
<h4 class="text-sm font-medium text-green-800">Cotisations à jour</h4>
<p class="text-sm text-green-700 mt-1">Excellent taux de cotisations ! 76% des membres sont à jour. Continuez à maintenir cette dynamique.</p>
</div>
</div>
<div class="flex items-start p-4 bg-yellow-50 rounded-lg">
<div class="flex-shrink-0">
<svg class="w-5 h-5 text-yellow-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"></path>
</svg>
</div>
<div class="ml-3">
<h4 class="text-sm font-medium text-yellow-800">Gestion des retards</h4>
<p class="text-sm text-yellow-700 mt-1">6 membres sont en retard de cotisation. Mettez en place un système de relances automatiques pour améliorer le taux de recouvrement.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="bg-white border-t border-gray-200">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="text-center">
<p class="text-gray-500 text-sm">© 2024 Amicale Universitaire. Tous droits réservés.</p>
<p class="text-gray-400 text-xs mt-2">Système de gestion financière développé pour les associations étudiantes</p>
</div>
</div>
</footer>
<script src="main.js"></script>
<script>
// Fonctions pour créer les graphiques avancés
function creerGraphiqueEvolutionMensuelle() {
if (typeof echarts === 'undefined') return;
const chartDom = document.getElementById('graphiqueEvolutionMensuelle');
if (!chartDom) return;
const myChart = echarts.init(chartDom);
// Données mensuelles simulées
const mois = ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun', 'Jul', 'Aoû', 'Sep', 'Oct'];
const entrees = [375, 300, 425, 350, 375, 400, 325, 350, 425, 375];
const sorties = [280, 320, 450, 380, 420, 390, 410, 360, 440, 400];
const option = {
tooltip: {
trigger: 'axis',
formatter: function(params) {
let result = params[0].name + '<br/>';
params.forEach(param => {
result += param.seriesName + ': ' + gestionFinanciere.formatMontant(param.value) + '<br/>';
});
return result;
}
},
legend: {
data: ['Entrées', 'Sorties']
},
xAxis: {
type: 'category',
data: mois
},
yAxis: {
type: 'value',
axisLabel: {
formatter: function(value) {
return gestionFinanciere.formatMontant(value);
}
}
},
series: [
{
name: 'Entrées',
type: 'bar',
data: entrees,
itemStyle: { color: '#10b981' }
},
{
name: 'Sorties',
type: 'bar',
data: sorties,
itemStyle: { color: '#ef4444' }
}
]
};
myChart.setOption(option);
}
function creerGraphiqueRepartitionCategories() {
if (typeof echarts === 'undefined') return;
const chartDom = document.getElementById('graphiqueRepartitionCategories');
if (!chartDom) return;
const myChart = echarts.init(chartDom);
// Calculer la répartition des dépenses par catégorie
const depensesParCategorie = {};
gestionFinanciere.mockData.transactions
.filter(t => t.type === 'sortie')
.forEach(transaction => {
depensesParCategorie[transaction.categorie] = (depensesParCategorie[transaction.categorie] || 0) + transaction.montant;
});
const data = Object.entries(depensesParCategorie).map(([categorie, montant]) => ({
name: categorie,
value: montant
}));
const option = {
tooltip: {
trigger: 'item',
formatter: function(params) {
return `${params.name}<br/>${gestionFinanciere.formatMontant(params.value)} (${params.percent}%)`;
}
},
series: [{
type: 'pie',
radius: ['40%', '70%'],
data: data,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}]
};
myChart.setOption(option);
}
function creerGraphiqueTendances() {
if (typeof echarts === 'undefined') return;
const chartDom = document.getElementById('graphiqueTendances');
if (!chartDom) return;
const myChart = echarts.init(chartDom);
// Données de tendance
const dates = ['2024-01', '2024-02', '2024-03', '2024-04', '2024-05', '2024-06', '2024-07', '2024-08', '2024-09', '2024-10'];
const solde = [1200, 1350, 1180, 1420, 1650, 1820, 1690, 1850, 1920, 2100];
const option = {
title: {
text: 'Évolution du solde sur 10 mois',
textStyle: { color: '#1e3a8a', fontSize: 16 }
},
tooltip: {
trigger: 'axis',
formatter: function(params) {
return `${params[0].name}<br/>Solde: ${gestionFinanciere.formatMontant(params[0].value)}`;
}
},
xAxis: {
type: 'category',
data: dates
},
yAxis: {
type: 'value',
axisLabel: {
formatter: function(value) {
return gestionFinanciere.formatMontant(value);
}
}
},
series: [{
data: solde,
type: 'line',
smooth: true,
itemStyle: { color: '#3b82f6' },
areaStyle: { color: 'rgba(59, 130, 246, 0.2)' }
}]
};
myChart.setOption(option);
}
function creerGraphiquePrevisions() {
if (typeof echarts === 'undefined') return;
const chartDom = document.getElementById('graphiquePrevisions');
if (!chartDom) return;
const myChart = echarts.init(chartDom);
// Données historiques et prévisions
const mois = ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun', 'Jul', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc'];
const historique = [2100, null, null, null, null, null, null, null, null, null, null, null];
const previsions = [null, 2200, 2350, 2100, 2450, 2600, 2400, 2650, 2800, 2550, 2750, 2900];
const option = {
tooltip: {
trigger: 'axis',
formatter: function(params) {
let result = params[0].name + '<br/>';
params.forEach(param => {
if (param.value !== null) {
result += param.seriesName + ': ' + gestionFinanciere.formatMontant(param.value) + '<br/>';
}
});
return result;
}
},
legend: {
data: ['Historique', 'Prévisions']
},
xAxis: {
type: 'category',
data: mois
},
yAxis: {
type: 'value',
axisLabel: {
formatter: function(value) {
return gestionFinanciere.formatMontant(value);
}
}
},
series: [
{
name: 'Historique',
type: 'line',
data: historique,
itemStyle: { color: '#10b981' },
lineStyle: { width: 3 }
},
{
name: 'Prévisions',
type: 'line',
data: previsions,
itemStyle: { color: '#f59e0b' },
lineStyle: { type: 'dashed', width: 2 }
}
]
};
myChart.setOption(option);
}
// Calculer les prévisions
function calculerPrevisions() {
const soldeActuel = gestionFinanciere.calculerSoldeActuel();
// Calculs simples basés sur les tendances
const previsionMois = soldeActuel * 1.05; // +5%
const previsionTrimestre = soldeActuel * 1.15; // +15%
const previsionAnnee = soldeActuel * 1.5; // +50%
document.getElementById('previsionMois').textContent = gestionFinanciere.formatMontant(previsionMois);
document.getElementById('previsionTrimestre').textContent = gestionFinanciere.formatMontant(previsionTrimestre);
document.getElementById('previsionAnnee').textContent = gestionFinanciere.formatMontant(previsionAnnee);
}
// Générer le rapport
function genererRapport() {
// Simuler la génération du rapport
alert('Rapport généré avec succès ! Les données ont été mises à jour.');
}
// Exporter en PDF
function exporterPDF() {
alert('Fonctionnalité d\'export PDF en cours de développement.');
}
// Exporter en CSV
function exporterCSV() {
alert('Fonctionnalité d\'export CSV en cours de développement.');
}
// Initialisation
document.addEventListener('DOMContentLoaded', function() {
// Calculer le solde de la période
const solde = gestionFinanciere.calculerSoldeActuel();
document.getElementById('soldePeriode').textContent = gestionFinanciere.formatMontant(solde);
// Calculer les totaux de la période
const transactions = gestionFinanciere.mockData.transactions;
const totalEntrees = transactions
.filter(t => t.type === 'entrée')
.reduce((sum, t) => sum + t.montant, 0);
const totalSorties = transactions
.filter(t => t.type === 'sortie')
.reduce((sum, t) => sum + t.montant, 0);
document.getElementById('totalEntreesPeriode').textContent = gestionFinanciere.formatMontant(totalEntrees);
document.getElementById('totalSortiesPeriode').textContent = gestionFinanciere.formatMontant(totalSorties);
// Calculer le taux de croissance
const tauxCroissance = ((solde - 1000) / 1000 * 100).toFixed(1);
document.getElementById('tauxCroissance').textContent = tauxCroissance + '%';
// Calculer les prévisions
calculerPrevisions();
// Créer les graphiques
setTimeout(() => {
creerGraphiqueEvolutionMensuelle();
creerGraphiqueRepartitionCategories();
creerGraphiqueTendances();
creerGraphiquePrevisions();
}, 500);
});
</script>
</body>
</html>