From 54af96b21bc4e565fa824d4e693f55765551b2d0 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Thu, 24 Mar 2016 11:38:05 +0100 Subject: [PATCH 1/2] Add : BILL_NEVER_BE_CANCELED In some case we don't want to allow cancel bill, forced to made an avoir --- htdocs/compta/facture.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b6469da3168..a1d22005d01 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->BILL_NEVER_BE_CANCELED)) + { + if ($objectidnext) + { + print '
' . $langs->trans('ClassifyCanceled') . '
'; + } + else + { + print '
' . $langs->trans('ClassifyCanceled') . '
'; + } } } } From 767ce063df661009fc152d7ea466a36222e00bf2 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 25 Mar 2016 18:16:05 +0100 Subject: [PATCH 2/2] Change done --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a1d22005d01..f05f638e060 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3963,7 +3963,7 @@ else if ($id > 0 || ! empty($ref)) } else { - if ( empty($conf->global->BILL_NEVER_BE_CANCELED)) + if ( empty($conf->global->INVOICE_CAN_NEVER_BE_CANCELED)) { if ($objectidnext) {