diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index a816a83a42826..5f291b9e5bd8f 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010 Regis Houssin * Copyright (C) 2011-2017 Laurent Destailleur * Copyright (C) 2014 Marcos GarcĂ­a - * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2022-2024 Ferran Marcet * Copyright (C) 2023 Alexandre Janniaux * Copyright (C) 2024 MDW * @@ -248,7 +248,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf $totalHTInvoices = 0; $areAllInvoicesValidated = true; foreach ($orderLinked->linkedObjects['facture'] as $key => $invoice) { - if ($invoice->statut == Facture::STATUS_VALIDATED || $object->id == $invoice->id) { + if ($invoice->statut == Facture::STATUS_VALIDATED || $invoice->statut == Facture::STATUS_CLOSED || $object->id == $invoice->id) { $totalHTInvoices += (float) $invoice->total_ht; } else { $areAllInvoicesValidated = false;