diff --git a/client/src/pages/Avoirs.tsx b/client/src/pages/Avoirs.tsx index 9cc3755..22e21e8 100644 --- a/client/src/pages/Avoirs.tsx +++ b/client/src/pages/Avoirs.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; -import { Plus, Search, FileText, CheckCircle, AlertCircle, Clock } from "lucide-react"; +import { Plus, Search, FileText, CheckCircle, AlertCircle, Clock, Edit, Trash2 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; @@ -418,112 +418,132 @@ export default function Avoirs() { )} - {/* Avoirs List */} -
- Commencez par créer votre premier avoir. -
-+ {searchTerm ? "Aucun avoir ne correspond à votre recherche." : "Commencez par créer votre premier avoir."} +
+ {canCreate && !searchTerm && ( + + )} +| + Statut + | ++ Référence + | ++ Fournisseur + | ++ Magasin + | ++ Montant + | ++ Créé le + | ++ Actions + | +
|---|---|---|---|---|---|---|
|
+
+ {getStatusIcon(avoir.status)}
+
+ |
+ + #{avoir.invoiceReference || 'Sans référence'} + | ++ {avoir.supplier.name} + | +
+
+
+ {avoir.group.name}
+
+ |
+ + {avoir.amount ? `${avoir.amount.toFixed(2)} €` : 'Non spécifié'} + | +
+
+
+ {format(new Date(avoir.createdAt), "dd/MM/yyyy", { locale: fr })}
+
+ Par {avoir.creator.firstName && avoir.creator.lastName
+ ? `${avoir.creator.firstName} ${avoir.creator.lastName}`
+ : avoir.creator.username
+ }
+
+ |
+
+ {canEditDelete ? (
+
+
+
+
+ ) : (
+ Lecture seule
+ )}
+ |
+