From 152fc2dea19296d0cbbd7e4ae1e87f6f73d4dd0a Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 8 Sep 2025 18:27:24 +0000 Subject: [PATCH] Update task status handling and add validation functionality Modify the Avoirs page to allow inline status updates via a dropdown and implement validation logic with a "Validate" button. Admins gain the ability to devalidate entries. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/F5ROn6G --- client/src/pages/Avoirs.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/client/src/pages/Avoirs.tsx b/client/src/pages/Avoirs.tsx index 60455e1..2327e2c 100644 --- a/client/src/pages/Avoirs.tsx +++ b/client/src/pages/Avoirs.tsx @@ -336,6 +336,25 @@ export default function Avoirs() { setIsDeleteDialogOpen(true); }; + // Handle status change + const handleStatusChange = (avoirId: number, newStatus: string) => { + const avoir = avoirs.find(a => a.id === avoirId); + if (avoir) { + editAvoirMutation.mutate({ + id: avoirId, + data: { + supplierId: avoir.supplierId, + groupId: avoir.groupId, + invoiceReference: avoir.invoiceReference || "", + amount: avoir.amount, + comment: avoir.comment || "", + commercialProcessed: avoir.commercialProcessed, + status: newStatus as "En attente de demande" | "Demandé" | "Reçu", + } + }); + } + }; + // 🔍 FONCTION DE VÉRIFICATION DE FACTURE (comme rapprochement) const verifyAvoirInvoiceMutation = useMutation({ mutationFn: async ({ avoirId, invoiceReference, forceRefresh }: { avoirId: number; invoiceReference?: string; forceRefresh?: boolean }) => {