fix: Update PrimeReact to v10.8.3 and fix all compilation errors

This commit is contained in:
dahoud
2025-10-13 03:01:36 +00:00
parent 2a2e54c0e3
commit 30cad6220b
85 changed files with 928 additions and 2020 deletions

View File

@@ -18,6 +18,7 @@ import { Divider } from 'primereact/divider';
import { factureService, clientService } from '../../../../services/api';
import { formatDate, formatCurrency } from '../../../../utils/formatters';
import type { Facture, Client } from '../../../../types/btp';
import { StatutFacture, TypeFacture } from '../../../../types/btp';
interface ExportConfig {
format: string;
@@ -90,7 +91,7 @@ const FactureExportPage = () => {
// Charger les clients
const clientsResponse = await clientService.getAll();
setClients(clientsResponse.data);
setClients(clientsResponse);
} catch (error) {
console.error('Erreur lors du chargement:', error);
@@ -123,44 +124,44 @@ const FactureExportPage = () => {
id: '1',
numero: 'FAC-2024-001',
objet: 'Rénovation salle de bain',
type: 'FACTURE',
statut: 'PAYEE',
dateEmission: new Date('2024-01-15'),
dateEcheance: new Date('2024-02-15'),
typeFacture: TypeFacture.FACTURE,
statut: StatutFacture.PAYEE,
dateEmission: new Date('2024-01-15').toISOString(),
dateEcheance: new Date('2024-02-15').toISOString(),
client: { id: '1', nom: 'Dupont Construction' } as Client,
montantHT: 2500,
montantTTC: 3000,
tauxTVA: 20,
montantPaye: 3000
},
} as Facture,
{
id: '2',
numero: 'FAC-2024-002',
objet: 'Extension maison',
type: 'ACOMPTE',
statut: 'ENVOYEE',
dateEmission: new Date('2024-02-01'),
dateEcheance: new Date('2024-03-01'),
typeFacture: TypeFacture.ACOMPTE,
statut: StatutFacture.ENVOYEE,
dateEmission: new Date('2024-02-01').toISOString(),
dateEcheance: new Date('2024-03-01').toISOString(),
client: { id: '2', nom: 'Martin SARL' } as Client,
montantHT: 5000,
montantTTC: 6000,
tauxTVA: 20,
montantPaye: 0
},
} as Facture,
{
id: '3',
numero: 'FAC-2024-003',
objet: 'Travaux électricité',
type: 'FACTURE',
statut: 'EN_RETARD',
dateEmission: new Date('2024-01-20'),
dateEcheance: new Date('2024-02-20'),
typeFacture: TypeFacture.FACTURE,
statut: StatutFacture.ECHUE,
dateEmission: new Date('2024-01-20').toISOString(),
dateEcheance: new Date('2024-02-20').toISOString(),
client: { id: '3', nom: 'Bâti Plus' } as Client,
montantHT: 1800,
montantTTC: 2160,
tauxTVA: 20,
montantPaye: 0
}
} as Facture
];
// Appliquer les filtres
@@ -171,7 +172,7 @@ const FactureExportPage = () => {
}
if (config.types.length > 0) {
facturesFiltrees = facturesFiltrees.filter(f => config.types.includes(f.type));
facturesFiltrees = facturesFiltrees.filter(f => config.types.includes(f.typeFacture));
}
if (config.clients.length > 0) {
@@ -504,9 +505,9 @@ const FactureExportPage = () => {
field="statut"
header="Statut"
body={(rowData) => (
<Tag
value={rowData.statut}
severity={getStatutSeverity(rowData.statut)}
<Tag
value={rowData.statut}
severity={getStatutSeverity(rowData.statut) as any}
/>
)}
/>