diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index e7cb0b1d4b5..55ee99f4cb6 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -102,19 +102,24 @@ print load_fiche_titre($langs->trans("AccountancyTreasuryArea"), '', 'bill');
print '
';
-print getNumberInvoicesPieChart('customers');
-print '
';
+if (isModEnabled('facture')) {
+ print getNumberInvoicesPieChart('customers');
+ print '
';
+}
-if (!empty($conf->fournisseur->enabled)) {
+if (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) {
print getNumberInvoicesPieChart('fourn');
print '
';
}
-print getCustomerInvoiceDraftTable($max, $socid);
-
-if (!empty($conf->fournisseur->enabled)) {
+if (isModEnabled('facture')) {
+ print getCustomerInvoiceDraftTable($max, $socid);
print '
';
+}
+
+if (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) {
print getDraftSupplierTable($max, $socid);
+ print '
';
}
print '
';
@@ -273,7 +278,7 @@ if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
// Last modified supplier invoices
-if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
+if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) {
$langs->load("boxes");
$facstatic = new FactureFournisseur($db);
@@ -400,7 +405,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
// Latest donations
-if (!empty($conf->don->enabled) && !empty($user->rights->don->lire)) {
+if (isModEnabled('don') && !empty($user->rights->don->lire)) {
include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
$langs->load("boxes");
@@ -490,7 +495,7 @@ if (!empty($conf->don->enabled) && !empty($user->rights->don->lire)) {
/**
* Social contributions to pay
*/
-if (!empty($conf->tax->enabled) && !empty($user->rights->tax->charges->lire)) {
+if (isModEnabled('tax') && !empty($user->rights->tax->charges->lire)) {
if (!$socid) {
$chargestatic = new ChargeSociales($db);
@@ -582,7 +587,7 @@ if (!empty($conf->tax->enabled) && !empty($user->rights->tax->charges->lire)) {
/*
* Customers orders to be billed
*/
-if (isModEnabled('facture') && !empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
+if (isModEnabled('facture') && isModEnabled('commande') && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
$commandestatic = new Commande($db);
$langs->load("orders");
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index ea53ae065e3..52daea0f150 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -254,7 +254,9 @@ function supplier_invoice_rec_prepare_head($object)
function getNumberInvoicesPieChart($mode)
{
global $conf, $db, $langs, $user;
- if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
+ if (($mode == 'customers' && isModEnabled('facture') && !empty($user->rights->facture->lire))
+ || ($mode = 'suppliers') && (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) && !empty($user->rights->facture->lire)
+ ) {
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
$now = date_create(date('Y-m-d', dol_now()));
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 5b43bc2b457..c8d7d48ff1c 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1129,7 +1129,7 @@ ValueOfConstantKey=Value of a configuration constant
ConstantIsOn=Option %s is on
NbOfDays=No. of days
AtEndOfMonth=At end of month
-CurrentNext=Current/Next
+CurrentNext=A given day in month
Offset=Offset
AlwaysActive=Always active
Upgrade=Upgrade