fix: Resolve TypeScript errors in page.tsx and phases-chantier/page.tsx
This commit is contained in:
@@ -255,8 +255,7 @@ const FacturesPage = () => {
|
||||
|
||||
const editFacture = (facture: Facture) => {
|
||||
setFacture({
|
||||
...facture,
|
||||
client: facture.client?.id || null
|
||||
...facture
|
||||
});
|
||||
setFactureDialog(true);
|
||||
};
|
||||
@@ -390,7 +389,7 @@ const FacturesPage = () => {
|
||||
/>
|
||||
<ActionButton
|
||||
icon="pi pi-send"
|
||||
color="secondary"
|
||||
color="blue"
|
||||
tooltip="Envoyer par email"
|
||||
onClick={() => {
|
||||
toast.current?.show({
|
||||
@@ -402,10 +401,12 @@ const FacturesPage = () => {
|
||||
}}
|
||||
/>
|
||||
<EditButton
|
||||
onClick={() => editFacture(rowData)}
|
||||
tooltip="Modifier"
|
||||
onClick={() => editFacture(rowData)}
|
||||
/>
|
||||
<DeleteButton
|
||||
onClick={() => confirmDeleteFacture(rowData)}
|
||||
tooltip="Supprimer"
|
||||
onClick={() => confirmDeleteFacture(rowData)}
|
||||
/>
|
||||
</ActionButtonGroup>
|
||||
);
|
||||
@@ -456,9 +457,9 @@ const FacturesPage = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Tag
|
||||
value={getTypeLabel(rowData.type)}
|
||||
severity={rowData.type === 'AVOIR' ? 'warning' : 'info'}
|
||||
<Tag
|
||||
value={getTypeLabel(rowData.typeFacture)}
|
||||
severity={rowData.typeFacture === 'AVOIR' ? 'warning' : 'info'}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -526,6 +527,7 @@ const FacturesPage = () => {
|
||||
value={factures}
|
||||
selection={selectedFactures}
|
||||
onSelectionChange={(e) => setSelectedFactures(e.value)}
|
||||
selectionMode="checkbox"
|
||||
dataKey="id"
|
||||
paginator
|
||||
rows={10}
|
||||
@@ -575,12 +577,12 @@ const FacturesPage = () => {
|
||||
</div>
|
||||
|
||||
<div className="field col-12 md:col-6">
|
||||
<label htmlFor="type">Type</label>
|
||||
<Dropdown
|
||||
id="type"
|
||||
value={facture.type}
|
||||
options={types}
|
||||
onChange={(e) => onDropdownChange(e, 'type')}
|
||||
<label htmlFor="typeFacture">Type</label>
|
||||
<Dropdown
|
||||
id="typeFacture"
|
||||
value={facture.typeFacture}
|
||||
options={types}
|
||||
onChange={(e) => onDropdownChange(e, 'typeFacture')}
|
||||
placeholder="Sélectionnez un type"
|
||||
/>
|
||||
</div>
|
||||
@@ -636,35 +638,35 @@ const FacturesPage = () => {
|
||||
|
||||
<div className="field col-12 md:col-4">
|
||||
<label htmlFor="dateEmission">Date d'émission</label>
|
||||
<Calendar
|
||||
id="dateEmission"
|
||||
value={facture.dateEmission}
|
||||
onChange={(e) => onDateChange(e, 'dateEmission')}
|
||||
dateFormat="dd/mm/yy"
|
||||
showIcon
|
||||
<Calendar
|
||||
id="dateEmission"
|
||||
value={facture.dateEmission ? new Date(facture.dateEmission) : null}
|
||||
onChange={(e) => onDateChange(e, 'dateEmission')}
|
||||
dateFormat="dd/mm/yy"
|
||||
showIcon
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="field col-12 md:col-4">
|
||||
<label htmlFor="dateEcheance">Date d'échéance</label>
|
||||
<Calendar
|
||||
id="dateEcheance"
|
||||
value={facture.dateEcheance}
|
||||
onChange={(e) => onDateChange(e, 'dateEcheance')}
|
||||
dateFormat="dd/mm/yy"
|
||||
showIcon
|
||||
minDate={facture.dateEmission}
|
||||
<Calendar
|
||||
id="dateEcheance"
|
||||
value={facture.dateEcheance ? new Date(facture.dateEcheance) : null}
|
||||
onChange={(e) => onDateChange(e, 'dateEcheance')}
|
||||
dateFormat="dd/mm/yy"
|
||||
showIcon
|
||||
minDate={facture.dateEmission ? new Date(facture.dateEmission) : undefined}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="field col-12 md:col-4">
|
||||
<label htmlFor="datePaiement">Date de paiement</label>
|
||||
<Calendar
|
||||
id="datePaiement"
|
||||
value={facture.datePaiement}
|
||||
onChange={(e) => onDateChange(e, 'datePaiement')}
|
||||
dateFormat="dd/mm/yy"
|
||||
showIcon
|
||||
<Calendar
|
||||
id="datePaiement"
|
||||
value={facture.datePaiement ? new Date(facture.datePaiement) : null}
|
||||
onChange={(e) => onDateChange(e, 'datePaiement')}
|
||||
dateFormat="dd/mm/yy"
|
||||
showIcon
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user