Merge pull request #464 from R0m1k3/1.1

1.1
This commit is contained in:
LogiFlow authored and GitHub committed 2025-09-23 15:57:06 +02:00
commit 79fcdeb541
3 files changed
+31 -7

No files matched your search

-4
View File
@@ -19,10 +19,6 @@ externalPort = 80
localPort = 33873
externalPort = 3003
[[ports]]
localPort = 38213
externalPort = 5000
[[ports]]
localPort = 38343
externalPort = 3000
@@ -58,6 +58,9 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R
description: "Commentaire ajouté avec succès",
});
queryClient.invalidateQueries({ queryKey: [`/api/deliveries/${deliveryId}/reconciliation-comments`] });
// Invalider aussi les queries des livraisons pour mettre à jour le compteur de commentaires
queryClient.invalidateQueries({ queryKey: ['/api/deliveries'] });
queryClient.invalidateQueries({ queryKey: ['/api/deliveries/bl'] });
setIsAdding(false);
setNewComment("");
},
@@ -81,6 +84,9 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R
description: "Commentaire modifié avec succès",
});
queryClient.invalidateQueries({ queryKey: [`/api/deliveries/${deliveryId}/reconciliation-comments`] });
// Invalider aussi les queries des livraisons pour mettre à jour le compteur de commentaires
queryClient.invalidateQueries({ queryKey: ['/api/deliveries'] });
queryClient.invalidateQueries({ queryKey: ['/api/deliveries/bl'] });
setEditingId(null);
},
onError: (error: any) => {
@@ -103,6 +109,9 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R
description: "Commentaire supprimé avec succès",
});
queryClient.invalidateQueries({ queryKey: [`/api/deliveries/${deliveryId}/reconciliation-comments`] });
// Invalider aussi les queries des livraisons pour mettre à jour le compteur de commentaires
queryClient.invalidateQueries({ queryKey: ['/api/deliveries'] });
queryClient.invalidateQueries({ queryKey: ['/api/deliveries/bl'] });
},
onError: (error: any) => {
toast({
+22 -3
View File
@@ -1132,6 +1132,15 @@ export default function BLReconciliation() {
((parseFloat(delivery.invoiceAmount) - parseFloat(delivery.blAmount)) / parseFloat(delivery.blAmount) * 100).toFixed(1) :
null;
// Log pour déboguer le problème des commentaires
if (import.meta.env.DEV && delivery.reconciliationCommentsCount) {
console.log('🔍 Validated delivery comments:', {
deliveryId: delivery.id,
commentsCount: delivery.reconciliationCommentsCount,
hasComments: delivery.reconciliationCommentsCount > 0
});
}
return (
<tr key={delivery.id} className="hover:bg-gray-50 bg-green-50">
<td className="px-6 py-4 whitespace-nowrap">
@@ -1200,10 +1209,20 @@ export default function BLReconciliation() {
<div className="flex items-center justify-end space-x-2">
<button
onClick={() => handleOpenCommentModal(delivery)}
className="transition-colors duration-200 p-1 rounded text-gray-600 hover:text-gray-700 hover:bg-gray-50 opacity-70"
title="Voir/Gérer les commentaires"
className={`transition-colors duration-200 p-1 rounded ${
delivery.reconciliationCommentsCount && delivery.reconciliationCommentsCount > 0
? 'text-blue-600 hover:text-blue-700 hover:bg-blue-50'
: 'text-gray-600 hover:text-gray-700 hover:bg-gray-50'
} opacity-70`}
title={`Voir/Gérer les commentaires ${
delivery.reconciliationCommentsCount ? `(${delivery.reconciliationCommentsCount})` : ''
}`}
>
<MessageSquare className="h-4 w-4" />
<MessageSquare className={`h-4 w-4 ${
delivery.reconciliationCommentsCount && delivery.reconciliationCommentsCount > 0
? 'fill-blue-200'
: ''
}`} />
</button>
{(permissions.canEdit('reconciliation') || permissions.canValidate('reconciliation')) && (
<button