From ff9ec5c605f7e50072c6300eadec99e15f85f5cb Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 8 Sep 2025 20:37:17 +0000 Subject: [PATCH] Add ability to view and manage comments on financial documents Implement a modal for viewing and managing comments associated with financial documents, enhancing user interaction and information display. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/Ii96ETr --- client/src/pages/Avoirs.tsx | 49 ++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/client/src/pages/Avoirs.tsx b/client/src/pages/Avoirs.tsx index 05b99a6..9516c49 100644 --- a/client/src/pages/Avoirs.tsx +++ b/client/src/pages/Avoirs.tsx @@ -1,6 +1,6 @@ import { useState, useEffect } from "react"; import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; -import { Plus, Search, FileText, CheckCircle, AlertCircle, Clock, Edit, Trash2, UserCheck, Send, Upload, XCircle } from "lucide-react"; +import { Plus, Search, FileText, CheckCircle, AlertCircle, Clock, Edit, Trash2, UserCheck, Send, Upload, XCircle, MessageSquare } from "lucide-react"; import { useStore } from "@/components/Layout"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; @@ -131,6 +131,10 @@ export default function Avoirs() { // ✅ État local pour le champ montant d'édition pour éviter les conflits avec React Hook Form const [editAmountValue, setEditAmountValue] = useState(""); + + // État pour le modal de commentaire + const [showCommentModal, setShowCommentModal] = useState(false); + const [selectedComment, setSelectedComment] = useState(""); // Utiliser le contexte global du magasin const { selectedStoreId } = useStore(); const { toast } = useToast(); @@ -432,6 +436,12 @@ export default function Avoirs() { setIsDeleteDialogOpen(true); }; + // Handle comment view + const handleViewComment = (comment: string) => { + setSelectedComment(comment); + setShowCommentModal(true); + }; + // Handle status change const handleStatusChange = (avoirId: number, newStatus: string) => { const avoir = avoirs?.find(a => a?.id === avoirId); @@ -1275,6 +1285,19 @@ export default function Avoirs() { )} + {/* Bouton Commentaire - apparaît seulement s'il y a un commentaire */} + {avoir.comment && avoir.comment.trim() !== '' && ( + + )} + {canEditDelete && ( <> + + + ); } \ No newline at end of file