From 03d126810cf34e80283b1688558aa4a1745a2dd6 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 29 Sep 2016 10:15:34 +0200 Subject: [PATCH] FIX : "reopen " new right must respect advanced user rights management --- htdocs/compta/facture.php | 2 +- htdocs/core/modules/modFacture.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 48d5a01930b..9e76b37c8ce 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3925,7 +3925,7 @@ else if ($id > 0 || ! empty($ref)) || ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id)) || ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))) && ($object->statut == 2 || $object->statut == 3 || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data - && $user->rights->facture->creer && $user->rights->facture->invoice_advance->reopen) // A paid invoice (partially or completely) + && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->invoice_advance->reopen))) // A paid invoice (partially or completely) { if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice { diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 1d9cde757f1..8d268728d35 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -187,7 +187,7 @@ class modFacture extends DolibarrModules $this->rights[$r][0] = 1322; $this->rights[$r][1] = 'Rouvrir une facture totalement réglée'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'invoice_advance'; $this->rights[$r][5] = 'reopen';