mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-20 21:49:07 +02:00
2 files changed
+14
-4
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -1085,14 +1085,24 @@ export default function Avoirs() {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Bouton Dévalider */}
|
{/* Bouton Dévalider - Pour admin: sur avoirs validés OU statut Reçu */}
|
||||||
{avoir.nocodbVerified && canEditDelete && (
|
{canEditDelete && (
|
||||||
|
(avoir.nocodbVerified ||
|
||||||
|
((user as any)?.role === 'admin' && avoir.status === 'Reçu'))
|
||||||
|
) && (
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-8 w-8 p-0 text-orange-600 hover:text-orange-700 hover:bg-orange-50"
|
className="h-8 w-8 p-0 text-orange-600 hover:text-orange-700 hover:bg-orange-50"
|
||||||
title="Dévalider l'avoir"
|
title={avoir.nocodbVerified ? "Dévalider l'avoir" : "Remettre en statut Demandé"}
|
||||||
onClick={() => handleDevalidateAvoir(avoir.id)}
|
onClick={() => {
|
||||||
|
if (avoir.nocodbVerified) {
|
||||||
|
handleDevalidateAvoir(avoir.id);
|
||||||
|
} else if ((user as any)?.role === 'admin' && avoir.status === 'Reçu') {
|
||||||
|
// Pour les avoirs non-validés mais avec statut Reçu, changer le statut
|
||||||
|
handleStatusChange(avoir.id, 'Demandé');
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<XCircle className="h-4 w-4" />
|
<XCircle className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in new issue
Block a user