diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c421bb7f41a..48d5a01930b 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->reopen) // A paid invoice (partially or completely) + && $user->rights->facture->creer && $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 fd0832f9c9d..1d9cde757f1 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -187,8 +187,9 @@ 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] = 0; - $this->rights[$r][4] = 'reopen'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'invoice_advance'; + $this->rights[$r][5] = 'reopen'; // Exports