mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-21 14:08:15 +02:00
Update validation logic to allow unvalidation only after initial validation
Adjusted the unvalidation button's visibility and functionality to be conditional on the initial validation status, ensuring a sequential workflow. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/yiEpJFx
This commit is contained in:
1 parent
2c9293cab6
commit
1936f0231b
1 file changed
+4
-14
@@ -1085,24 +1085,14 @@ export default function Avoirs() {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Bouton Dévalider - Pour admin: sur avoirs validés OU statut Reçu */}
|
{/* Bouton Dévalider - Uniquement sur les avoirs validés */}
|
||||||
{canEditDelete && (
|
{avoir.nocodbVerified && 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={avoir.nocodbVerified ? "Dévalider l'avoir" : "Remettre en statut Demandé"}
|
title="Dévalider l'avoir"
|
||||||
onClick={() => {
|
onClick={() => handleDevalidateAvoir(avoir.id)}
|
||||||
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