diff --git a/client/src/pages/Invoices.tsx b/client/src/pages/Invoices.tsx index ad59a2c..055d0e6 100644 --- a/client/src/pages/Invoices.tsx +++ b/client/src/pages/Invoices.tsx @@ -52,6 +52,8 @@ export default function Invoices() { const [selectedIds, setSelectedIds] = useState([]); const [statusFilter, setStatusFilter] = useState("all"); const [recipientFilter, setRecipientFilter] = useState("all"); + const [subscriptionFilter, setSubscriptionFilter] = useState("all"); // all | yes | no + const [entityFilter, setEntityFilter] = useState("all"); // all | santinova | itinova const [deleteDialogOpen, setDeleteDialogOpen] = useState(false); const [invoiceToDelete, setInvoiceToDelete] = useState(null); const [addDialogOpen, setAddDialogOpen] = useState(false); @@ -236,7 +238,18 @@ export default function Invoices() { if ((inv as any).recipientName !== recipientFilter) return false; } } - + // Filter by subscription + if (subscriptionFilter !== "all") { + const isSub = (inv as any).isSubscription === 1 || (inv as any).isSubscription === true; + if (subscriptionFilter === "yes" && !isSub) return false; + if (subscriptionFilter === "no" && isSub) return false; + } + // Filter by entity (SANTINOVA = ventilationComptable === 'SANTINOVA', ITINOVA = autre) + if (entityFilter !== "all") { + const ventil = ((inv as any).ventilationComptable || "").toUpperCase(); + if (entityFilter === "santinova" && ventil !== "SANTINOVA") return false; + if (entityFilter === "itinova" && ventil === "SANTINOVA") return false; + } return true; }); @@ -420,6 +433,32 @@ export default function Invoices() { + {/* Filtre Abonnement */} +
+ +
+ {/* Filtre Entité */} +
+ +
{/* Mode compact/détail + Tri */}