Merge pull request #5773 from atm-gauthier/NEW_reopen_bills_is_a_distinct_right
NEW : Reopen a paid bill is a user right
This commit is contained in:
commit
03876ba637
@ -3833,7 +3833,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) // 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
|
||||
{
|
||||
|
||||
@ -183,6 +183,14 @@ class modFacture extends DolibarrModules
|
||||
$this->rights[$r][4] = 'facture';
|
||||
$this->rights[$r][5] = 'export';
|
||||
|
||||
$r++;
|
||||
$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] = 'invoice_advance';
|
||||
$this->rights[$r][5] = 'reopen';
|
||||
|
||||
|
||||
// Menus
|
||||
//-------
|
||||
|
||||
@ -757,6 +757,7 @@ Permission1236=Export supplier invoices, attributes and payments
|
||||
Permission1237=Export supplier orders and their details
|
||||
Permission1251=Run mass imports of external data into database (data load)
|
||||
Permission1321=Export customer invoices, attributes and payments
|
||||
Permission1322=Reopen a paid bill
|
||||
Permission1421=Export customer orders and attributes
|
||||
Permission20001=Read leave requests (yours and your subordinates)
|
||||
Permission20002=Create/modify your leave requests
|
||||
|
||||
Loading…
Reference in New Issue
Block a user