diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 7298eb18135..300ff001cf6 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3953,6 +3953,7 @@ else if ($id > 0 || ! empty($ref)) } // Classify 'closed not completely paid' (possible si validee et pas encore classee payee) + if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 && $user->rights->facture->paiement) { if ($totalpaye > 0 || $totalcreditnotes > 0) @@ -3962,10 +3963,16 @@ else if ($id > 0 || ! empty($ref)) } else { - if ($objectidnext) { - print '
' . $langs->trans('ClassifyCanceled') . '
'; - } else { - print '
' . $langs->trans('ClassifyCanceled') . '
'; + if ( empty($conf->global->INVOICE_CAN_NEVER_BE_CANCELED)) + { + if ($objectidnext) + { + print '
' . $langs->trans('ClassifyCanceled') . '
'; + } + else + { + print '
' . $langs->trans('ClassifyCanceled') . '
'; + } } } }