Checkpoint: Renommage menus (Paramètres IA et Signatures, Paramètres import/export), paramètres export BAP refondus (switches indépendants navigateur+dossier, types local/Teams/SharePoint), historique BAP simplifié (colonnes supprimées, bouton Réexporter), import manuel par dossier entier
This commit is contained in:
@@ -12,14 +12,12 @@ import {
|
||||
CheckSquare,
|
||||
Search,
|
||||
Trash2,
|
||||
ExternalLink,
|
||||
FolderOpen,
|
||||
Monitor,
|
||||
Calendar,
|
||||
Building2,
|
||||
User,
|
||||
FileText,
|
||||
Download,
|
||||
RefreshCw,
|
||||
} from "lucide-react";
|
||||
|
||||
// Helper : télécharge un PDF annoté BAP depuis son URL de stockage
|
||||
@@ -193,15 +191,7 @@ export default function BapHistory() {
|
||||
Date validation
|
||||
</div>
|
||||
</TableHead>
|
||||
<TableHead>
|
||||
<div className="flex items-center gap-1">
|
||||
<Building2 className="h-3.5 w-3.5" />
|
||||
Fournisseur
|
||||
</div>
|
||||
</TableHead>
|
||||
<TableHead>N° Facture</TableHead>
|
||||
<TableHead>Montant</TableHead>
|
||||
<TableHead>Type achat</TableHead>
|
||||
<TableHead>
|
||||
<div className="flex items-center gap-1">
|
||||
<User className="h-3.5 w-3.5" />
|
||||
@@ -210,8 +200,8 @@ export default function BapHistory() {
|
||||
</TableHead>
|
||||
<TableHead>Service</TableHead>
|
||||
<TableHead>Signature</TableHead>
|
||||
<TableHead>Export</TableHead>
|
||||
<TableHead className="w-20">Actions</TableHead>
|
||||
<TableHead>PDF</TableHead>
|
||||
<TableHead className="w-28">Actions</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -220,31 +210,9 @@ export default function BapHistory() {
|
||||
<TableCell className="text-xs text-muted-foreground whitespace-nowrap">
|
||||
{formatDate(entry.validatedAt)}
|
||||
</TableCell>
|
||||
<TableCell className="font-medium max-w-[140px] truncate">
|
||||
{entry.supplierName || "—"}
|
||||
</TableCell>
|
||||
<TableCell className="text-sm">
|
||||
{entry.invoiceNumber || "—"}
|
||||
</TableCell>
|
||||
<TableCell className="text-sm font-mono">
|
||||
{formatAmount(entry.totalAmount)}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{entry.typeAchat ? (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className={
|
||||
entry.typeAchat.toLowerCase().includes("capex")
|
||||
? "border-blue-400 text-blue-700 dark:text-blue-300"
|
||||
: "border-green-400 text-green-700 dark:text-green-300"
|
||||
}
|
||||
>
|
||||
{entry.typeAchat.toUpperCase()}
|
||||
</Badge>
|
||||
) : (
|
||||
"—"
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className="text-sm max-w-[120px] truncate">
|
||||
{entry.recipientName || (
|
||||
<span className="text-muted-foreground italic text-xs">TOUS</span>
|
||||
@@ -263,7 +231,7 @@ export default function BapHistory() {
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{entry.exportMode === "browser" && entry.pdfUrl ? (
|
||||
{entry.pdfUrl ? (
|
||||
<div className="flex items-center gap-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
@@ -285,7 +253,7 @@ export default function BapHistory() {
|
||||
<Download className="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
</div>
|
||||
) : entry.exportMode === "folder" && entry.exportPath ? (
|
||||
) : entry.exportPath ? (
|
||||
<div className="flex items-center gap-1 text-orange-600">
|
||||
<FolderOpen className="h-3.5 w-3.5" />
|
||||
<span className="text-xs truncate max-w-[100px]" title={entry.exportPath}>
|
||||
@@ -297,15 +265,31 @@ export default function BapHistory() {
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-7 w-7 p-0 text-destructive hover:text-destructive hover:bg-destructive/10"
|
||||
onClick={() => handleDelete(entry.id)}
|
||||
disabled={deleteMutation.isPending}
|
||||
>
|
||||
<Trash2 className="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
<div className="flex items-center gap-1">
|
||||
{/* Bouton Réexporter */}
|
||||
{entry.pdfUrl && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-7 px-2 text-amber-600 hover:text-amber-700 hover:bg-amber-50"
|
||||
onClick={() => downloadBapPdf(entry.pdfUrl!, entry.supplierName, entry.invoiceNumber, entry.validatedAt)}
|
||||
title="Réexporter le PDF annoté"
|
||||
>
|
||||
<RefreshCw className="h-3.5 w-3.5 mr-1" />
|
||||
<span className="text-xs">Réexporter</span>
|
||||
</Button>
|
||||
)}
|
||||
{/* Bouton Supprimer */}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-7 w-7 p-0 text-destructive hover:text-destructive hover:bg-destructive/10"
|
||||
onClick={() => handleDelete(entry.id)}
|
||||
disabled={deleteMutation.isPending}
|
||||
>
|
||||
<Trash2 className="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user