From 87cc1b2601b4e935d11f1f2a3e8a95ba35d61ba0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 07:37:34 +0200 Subject: [PATCH] Add right supplier_invoice --- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/core/tpl/contacts.tpl.php | 14 +++++++++++--- htdocs/core/tpl/extrafields_view.tpl.php | 12 ++++++++++-- htdocs/core/tpl/notes.tpl.php | 12 ++++++++++-- htdocs/fourn/card.php | 4 ++-- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/commande/list.php | 4 ++-- htdocs/fourn/facture/card.php | 10 +++++----- htdocs/fourn/facture/contact.php | 6 +++--- htdocs/fourn/facture/document.php | 4 ++-- htdocs/fourn/facture/list.php | 8 ++++---- htdocs/fourn/facture/note.php | 4 ++-- htdocs/fourn/paiement/card.php | 18 +++++++++--------- htdocs/projet/card.php | 2 +- htdocs/projet/element.php | 4 ++-- htdocs/reception/card.php | 2 +- htdocs/reception/list.php | 4 ++-- 17 files changed, 69 insertions(+), 45 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 83da57c0594..440a6e021bc 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1038,7 +1038,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->societe->enabled) && !empty($conf->supplier_invoice->enabled)) { $langs->load("bills"); $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create'); + $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), '', $mainmenu, 'suppliers_bills_create'); $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 4c57ec953d4..511c03a931b 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -44,9 +44,17 @@ if ($module == 'propal') { } elseif ($module == 'fichinter') { $permission = $user->rights->ficheinter->creer; } elseif ($module == 'order_supplier') { - $permission = $user->rights->fournisseur->commande->creer; -} elseif ($module == 'invoice_supplier') { - $permission = $user->rights->fournisseur->facture->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permission = $user->rights->fournisseur->commande->creer; + } else { + $permission = $user->rights->supplier_order->creer; + } +} elseif ($module == 'invoice_supplier' && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permission = $user->rights->fournisseur->facture->creer; + } else { + $permission = $user->rights->supplier_invoice->creer; + } } elseif ($module == 'project') { $permission = $user->rights->projet->creer; } elseif ($module == 'action') { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index d1613cee7e9..9c15a71f43c 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -162,10 +162,18 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $permok = !empty($user->rights->$keyforperm->creer) || !empty($user->rights->$keyforperm->create) || !empty($user->rights->$keyforperm->write); } if ($object->element == 'order_supplier') { - $permok = $user->rights->fournisseur->commande->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permok = $user->rights->fournisseur->commande->creer; + } else { + $permok = $user->rights->supplier_order->creer; + } } if ($object->element == 'invoice_supplier') { - $permok = $user->rights->fournisseur->facture->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permok = $user->rights->fournisseur->facture->creer; + } else { + $permok = $user->rights->supplier_invoice->creer; + } } if ($object->element == 'shipping') { $permok = $user->rights->expedition->creer; diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 60b541d8afb..6c01c44bc36 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -70,9 +70,17 @@ if ($module == 'propal') { } elseif ($module == 'project_task') { $permission = $user->rights->projet->creer; } elseif ($module == 'invoice_supplier') { - $permission = $user->rights->fournisseur->facture->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permission = $user->rights->fournisseur->facture->creer; + } else { + $permission = $user->rights->supplier_invoice->creer; + } } elseif ($module == 'order_supplier') { - $permission = $user->rights->fournisseur->commande->creer; + if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { + $permission = $user->rights->fournisseur->commande->creer; + } else { + $permission = $user->rights->supplier_order->creer; + } } elseif ($module == 'societe') { $permission = $user->rights->societe->creer; } elseif ($module == 'contact') { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 18c65bcf3c6..4c86617d95a 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -841,7 +841,7 @@ if ($object->id > 0) { } } - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { if (!empty($orders2invoice) && $orders2invoice > 0) { if ($object->status == 1) { // Company is open @@ -854,7 +854,7 @@ if ($object->id > 0) { } } - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $langs->load("bills"); if ($object->status == 1) { print ''.$langs->trans("AddBill").''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 5dc72a402f2..c7d45c07f57 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2465,7 +2465,7 @@ if ($action == 'create') { //if (! empty($conf->facture->enabled)) //{ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { print ''.$langs->trans("CreateBill").''; } } @@ -2477,7 +2477,7 @@ if ($action == 'create') { print ''.$langs->trans("ClassifyBilled").''; } else { if (!empty($object->linkedObjectsIds['invoice_supplier'])) { - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { print ''.$langs->trans("ClassifyBilled").''; } } else { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 2417563c176..8eccc065783 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -459,7 +459,7 @@ if (empty($reshook)) { // Fac builddoc $donotredirect = 1; $upload_dir = $conf->fournisseur->facture->dir_output; - $permissiontoadd = $user->rights->fournisseur->facture->creer; + $permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); //include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -880,7 +880,7 @@ if ($resql) { 'builddoc'=>$langs->trans("PDFMerge"), 'presend'=>$langs->trans("SendByMail"), ); - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier"); } if ($user->rights->fournisseur->commande->supprimer) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 35b5cd214c8..578c9c7e062 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -111,9 +111,9 @@ $isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', 'rowid', $isdraft); // Common permissions -$usercanread = $user->rights->fournisseur->facture->lire; -$usercancreate = $user->rights->fournisseur->facture->creer; -$usercandelete = $user->rights->fournisseur->facture->supprimer; +$usercanread = ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire); +$usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); +$usercandelete = ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer); // Advanced permissions $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))); @@ -395,7 +395,7 @@ if (empty($reshook)) { } - if ($action == 'settransportmode' && $user->rights->fournisseur->facture->creer) { + if ($action == 'settransportmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { // transport mode $result = $object->setTransportMode(GETPOST('transport_mode_id', 'int')); } elseif ($action == 'setlabel' && $usercancreate) { @@ -2894,7 +2894,7 @@ if ($action == 'create') { print ''; - if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) { + if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { print ''; } print '
'; print $langs->trans('IntracommReportTransportMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 1284ee293be..236c3cd6948 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -53,7 +53,7 @@ $object = new FactureFournisseur($db); * Ajout d'un nouveau contact */ -if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) { +if ($action == 'addcontact' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { $result = $object->fetch($id, $ref); if ($result > 0 && $id > 0) { @@ -73,14 +73,14 @@ if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) { setEventMessages($object->error, $object->errors, 'errors'); } } -} elseif ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer) { +} elseif ($action == 'swapstatut' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { // bascule du statut d'un contact if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } else { dol_print_error($db); } -} elseif ($action == 'deletecontact' && $user->rights->fournisseur->facture->creer) { +} elseif ($action == 'deletecontact' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { // Efface un contact $object->fetch($id); $result = $object->delete_contact(GETPOST("lineid", 'int')); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 24009d35dbc..f75a8bd8ef3 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -251,8 +251,8 @@ if ($object->id > 0) { $modulepart = 'facture_fournisseur'; - $permission = $user->rights->fournisseur->facture->creer; - $permtoedit = $user->rights->fournisseur->facture->creer; + $permission = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); + $permtoedit = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); $param = '&facid='.$object->id; $defaulttpldir = '/core/tpl'; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 0b6e7aca99c..e30e1798a52 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -274,9 +274,9 @@ if (empty($reshook)) { // Mass actions $objectclass = 'FactureFournisseur'; $objectlabel = 'SupplierInvoices'; - $permissiontoread = $user->rights->fournisseur->facture->lire; - $permissiontoadd = $user->rights->fournisseur->facture->creer; - $permissiontodelete = $user->rights->fournisseur->facture->supprimer; + $permissiontoread = ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire); + $permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); + $permissiontodelete = ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer); $uploaddir = $conf->fournisseur->facture->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -878,7 +878,7 @@ if ($resql) { if (!empty($socid)) { $url .= '&socid='.$socid; } - $newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->rights->fournisseur->facture->creer); + $newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)); $i = 0; print '
'."\n"; diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 541121031ee..2cb8dfc66b1 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -48,7 +48,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); $object = new FactureFournisseur($db); $object->fetch($id, $ref); -$permissionnote = $user->rights->fournisseur->facture->creer; // Used by the include of actions_setnotes.inc.php +$permissionnote = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); // Used by the include of actions_setnotes.inc.php /* @@ -58,7 +58,7 @@ $permissionnote = $user->rights->fournisseur->facture->creer; // Used by the inc include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once // Set label -if ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) { +if ($action == 'setlabel' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { $object->label = $_POST['label']; $result = $object->update($user); if ($result < 0) { diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index f061385c5bb..ccc29105e4f 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -62,7 +62,7 @@ if ($socid && $socid != $object->thirdparty->id) { * Actions */ -if ($action == 'setnote' && $user->rights->fournisseur->facture->creer) { +if ($action == 'setnote' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { $db->begin(); $object->fetch($id); @@ -92,7 +92,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse } if ($action == 'confirm_validate' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer)) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->facture->creer) || !empty($user->rights->supplier_invoice->creer))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))) ) { $db->begin(); @@ -182,9 +182,9 @@ if ($result > 0) { print '';*/ // Date of payment - print ''.$form->editfieldkey("Date", 'datep', $object->date, $object, $object->statut == 0 && $user->rights->fournisseur->facture->creer).''; + print ''.$form->editfieldkey("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)).''; print ''; - print $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && $user->rights->fournisseur->facture->creer, 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded')); + print $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded')); print ''; // Payment mode @@ -241,9 +241,9 @@ if ($result > 0) { } // Note - print ''.$form->editfieldkey("Comments", 'note', $object->note, $object, $user->rights->fournisseur->facture->creer).''; + print ''.$form->editfieldkey("Comments", 'note', $object->note, $object, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)).''; print ''; - print $form->editfieldval("Note", 'note', $object->note, $object, $user->rights->fournisseur->facture->creer, 'textarea'); + print $form->editfieldval("Note", 'note', $object->note, $object, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'textarea'); print ''; print ''; @@ -336,7 +336,7 @@ if ($result > 0) { print '
'; if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->socid == 0 && $object->statut == 0 && $action == '') { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer)) + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->facture->creer) || !empty($user->rights->supplier_invoice->creer))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))) { print ''.$langs->trans('Valid').''; } @@ -363,8 +363,8 @@ if ($result > 0) { $ref = dol_sanitizeFileName($object->ref); $filedir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref); $urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id; - $genallowed = $user->rights->fournisseur->facture->lire; - $delallowed = $user->rights->fournisseur->facture->creer; + $genallowed = ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire); + $delallowed = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); $modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (empty($conf->global->SUPPLIER_PAYMENT_ADDON_PDF) ? '' : $conf->global->SUPPLIER_PAYMENT_ADDON_PDF)); print $formfile->showdocuments('supplier_payment', $ref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 40, 0, '', '', '', $societe->default_lang); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e39869c409f..ad38fc7aa6e 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1274,7 +1274,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("suppliers"); print ''.$langs->trans("AddSupplierOrder").''; } - if (!empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->creer) { + if (!empty($conf->supplier_invoice->enabled) && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { $langs->load("suppliers"); print ''.$langs->trans("AddSupplierInvoice").''; } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 083f80f836d..b248e24da86 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -437,8 +437,8 @@ $listofreferent = array( 'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'suppliers', 'buttonnew'=>'AddSupplierInvoice', - 'testnew'=>$user->rights->fournisseur->facture->creer, - 'test'=>$conf->supplier_invoice->enabled && $user->rights->fournisseur->facture->lire), + 'testnew'=>($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), + 'test'=>$conf->supplier_invoice->enabled && ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire), 'contract'=>array( 'name'=>"Contracts", 'title'=>"ListContractAssociatedProject", diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 22acecc574d..5ed59cf922b 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1983,7 +1983,7 @@ if ($action == 'create') { // Create bill if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) { - if ($user->rights->fournisseur->facture->creer) { + if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { // TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) // If we do that, we must also make this option official. print ''.$langs->trans("CreateBill").''; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index bdc65fb301b..a6891e38c79 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -384,7 +384,7 @@ if (empty($reshook)) { // Fac builddoc $donotredirect = 1; $upload_dir = $conf->fournisseur->facture->dir_output; - $permissiontoadd = $user->rights->fournisseur->facture->creer; + $permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -596,7 +596,7 @@ $arrayofmassactions = array( // 'presend'=>$langs->trans("SendByMail"), ); -if ($user->rights->fournisseur->facture->creer) { +if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier"); } if ($massaction == 'createbills') {