FIX : reopen invoice is an advanced right and default value is 1

This commit is contained in:
gauthier 2016-09-26 17:39:46 +02:00
parent 7ad2fda289
commit ad03bdf3b9
2 changed files with 4 additions and 3 deletions

View File

@ -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
{

View File

@ -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