mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Display invoice details and due date in reconciliation confirmation messages
Adds a toast notification to the invoice reconciliation process to display the invoice reference, amount, and due date if available, enhancing user feedback and error detection for missing due dates. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 917cea46-8014-4981-b291-34484d4d4b10 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/G9gVBac
This commit is contained in:
1 parent
3204f95c37
commit
cd600ff43a
1 file changed
+46
@@ -98,6 +98,52 @@ export default function BLReconciliation() {
|
||||
[variables.deliveryId]: result
|
||||
}));
|
||||
|
||||
// Toast de confirmation avec détails de la vérification
|
||||
if (result.exists) {
|
||||
// Formater la date d'échéance si présente
|
||||
let dueDateText = '';
|
||||
if (result.dueDate) {
|
||||
try {
|
||||
const date = new Date(result.dueDate);
|
||||
dueDateText = date.toLocaleDateString('fr-FR', {
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric'
|
||||
});
|
||||
} catch (e) {
|
||||
dueDateText = result.dueDate; // Afficher tel quel si le format n'est pas reconnu
|
||||
}
|
||||
}
|
||||
|
||||
// Formater le montant avec garde contre NaN
|
||||
const amountText = result.invoiceAmount ?
|
||||
(() => {
|
||||
const amount = parseFloat(result.invoiceAmount);
|
||||
return isNaN(amount) ? 'Format invalide' : `${amount.toFixed(2)}€`;
|
||||
})() :
|
||||
'Non disponible';
|
||||
|
||||
toast({
|
||||
title: "✅ Facture vérifiée avec succès",
|
||||
description: (
|
||||
<div className="space-y-1 text-sm">
|
||||
<div><strong>Référence :</strong> {result.invoiceReference || 'Non disponible'}</div>
|
||||
<div><strong>Montant :</strong> {amountText}</div>
|
||||
{result.dueDate ? (
|
||||
<div className="text-green-600 font-medium">
|
||||
<strong>📅 Échéance :</strong> {dueDateText}
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-orange-600 font-medium">
|
||||
⚠️ Aucune date d'échéance trouvée
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
duration: 5000,
|
||||
});
|
||||
}
|
||||
|
||||
// Auto-remplissage si facture trouvée via BL
|
||||
if (result.exists && result.matchType === 'bl_number' && result.invoiceReference) {
|
||||
// Auto-remplir les champs dans la livraison via API
|
||||
|
||||
Reference in new issue
Block a user