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

@@ -19,6 +19,7 @@ import { RadioButton } from 'primereact/radiobutton';
import { clientService, chantierService, devisService } from '../../../../services/api';
import { formatCurrency } from '../../../../utils/formatters';
import type { Facture, LigneFacture, Client, Chantier, Devis } from '../../../../types/btp';
import { StatutFacture, TypeFacture } from '../../../../types/btp';
interface LigneFactureFormData {
designation: string;
@@ -42,22 +43,22 @@ const NouvelleFacturePage = () => {
const [ligneDialog, setLigneDialog] = useState(false);
const [creationMode, setCreationMode] = useState<'manual' | 'from_devis'>('manual');
const [facture, setFacture] = useState<Facture>({
const [facture, setFacture] = useState<Partial<Facture>>({
id: '',
numero: '',
objet: '',
description: '',
dateEmission: new Date(),
dateEcheance: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000), // +30 jours
dateEmission: new Date().toISOString(),
dateEcheance: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(), // +30 jours
datePaiement: null,
statut: 'BROUILLON',
statut: StatutFacture.BROUILLON,
montantHT: 0,
tauxTVA: 20,
montantTVA: 0,
montantTTC: 0,
montantPaye: 0,
conditionsPaiement: 'Paiement à 30 jours fin de mois',
typeFacture: 'FACTURE',
typeFacture: TypeFacture.FACTURE,
actif: true,
client: null,
chantier: null,
@@ -119,8 +120,9 @@ const NouvelleFacturePage = () => {
useEffect(() => {
if (facture.client) {
loadChantiersByClient(facture.client as string);
loadDevisByClient(facture.client as string);
const clientId = typeof facture.client === 'string' ? facture.client : facture.client.id;
loadChantiersByClient(clientId);
loadDevisByClient(clientId);
} else {
setChantiers([]);
setDevisList([]);
@@ -995,4 +997,5 @@ const NouvelleFacturePage = () => {
);
};
export default NouvelleFacturePage;
export default NouvelleFacturePage;