diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
index 4072f22bf58..23a2a515873 100644
--- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
@@ -38,8 +38,8 @@ if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/com
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
-if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
-if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
+if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || ! empty($conf->supplier_invoice->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
+if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || ! empty($conf->supplier_order->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 8051b9684f9..f905c1b3f29 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -295,7 +295,7 @@ if ($object->id > 0)
print '';
print '';
- if (!empty($conf->fournisseur->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT))
+ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT))
{
print '
';
print '| ';
@@ -378,7 +378,7 @@ if ($object->id > 0)
if ($link) $boxstat .= '';
}
- if ($conf->fournisseur->enabled)
+ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
{
// Box proposals
$tmp = $object->getOutstandingOrders('supplier');
@@ -396,7 +396,7 @@ if ($object->id > 0)
if ($link) $boxstat .= '';
}
- if ($conf->fournisseur->enabled)
+ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
{
$tmp = $object->getOutstandingBills('supplier');
$outstandingOpened = $tmp['opened'];
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 797e3693614..0913f5ba43b 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -3185,7 +3185,7 @@ class CommandeFournisseur extends CommonOrder
{
global $conf, $langs;
- if (!empty($conf->fournisseur->enabled))
+ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php
index 207133d9cfa..f9650941555 100644
--- a/htdocs/fourn/index.php
+++ b/htdocs/fourn/index.php
@@ -97,7 +97,7 @@ else
// Draft orders
-if (!empty($conf->fournisseur->enabled))
+if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))
{
$langs->load("orders");
@@ -154,7 +154,7 @@ if (!empty($conf->fournisseur->enabled))
}
// Draft invoices
-if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
+if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
{
$sql = "SELECT ff.ref_supplier, ff.rowid, ff.total_ttc, ff.type";
$sql .= ", s.nom as name, s.rowid as socid";
diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php
index 2cd52bfeb77..8cda5a20d98 100644
--- a/htdocs/fourn/recap-fourn.php
+++ b/htdocs/fourn/recap-fourn.php
@@ -65,7 +65,7 @@ if ($socid > 0)
dol_banner_tab($societe, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom');
dol_fiche_end();
- if (!empty($conf->fournisseur->enabled) && $user->rights->facture->lire)
+ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->facture->lire)
{
// Invoice list
print load_fiche_titre($langs->trans("SupplierPreview"));
@@ -77,7 +77,7 @@ if ($socid > 0)
$sql .= " u.login, u.rowid as userid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id;
- $sql .= " AND f.entity IN (".getEntity("facture_fourn").")"; // Reconaissance de l'entité attribuée à cette facture pour Multicompany
+ $sql .= " AND f.entity IN (".getEntity("facture_fourn").")"; // Recognition of the entity attributed to this invoice for Multicompany
$sql .= " AND f.fk_user_valid = u.rowid";
$sql .= " ORDER BY f.datef DESC";
diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php
index 5d7d0039b7a..a31803d2d72 100644
--- a/htdocs/margin/tabs/thirdpartyMargins.php
+++ b/htdocs/margin/tabs/thirdpartyMargins.php
@@ -106,7 +106,7 @@ if ($socid > 0)
print ' |
';
}
- if (!empty($conf->fournisseur->enabled) && $object->fournisseur && !empty($user->rights->fournisseur->lire))
+ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || ! empty($conf->supplier_order->enabled) || ! empty($conf->supplier_invoice->enabled)) && $object->fournisseur && !empty($user->rights->fournisseur->lire))
{
print '| ';
print $langs->trans('SupplierCode').' | ';
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index f3ef5441144..e1fe84600d1 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -564,7 +564,7 @@ $rowspan = 4;
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $rowspan++;
if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) $rowspan++;
if (!empty($conf->global->MAIN_MULTILANGS)) $rowspan++;
-if (!empty($conf->fournisseur->enabled)) $rowspan++;
+if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || ! empty($conf->supplier_order->enabled) || ! empty($conf->supplier_invoice->enabled)) $rowspan++;
print ' |
';
@@ -680,7 +680,7 @@ if (!empty($conf->global->MAIN_MULTILANGS))
print '
';
}
-if (!empty($conf->fournisseur->enabled))
+if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || ! empty($conf->supplier_order->enabled) || ! empty($conf->supplier_invoice->enabled))
{
print '';
print '| '.$langs->trans("UseProductFournDesc").' | ';
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 96b2165c65a..7e29180a6e7 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -4872,19 +4872,19 @@ class Product extends CommonObject
if ($result < 0) dol_print_error($this->db, $this->error);
$stock_sending_client = $this->stats_expedition['qty'];
}
- if (!empty($conf->fournisseur->enabled))
+ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || ! empty($conf->supplier_order->enabled))
{
$result = $this->load_stats_commande_fournisseur(0, '1,2,3,4', 1);
if ($result < 0) dol_print_error($this->db, $this->error);
$stock_commande_fournisseur = $this->stats_commande_fournisseur['qty'];
}
- if (!empty($conf->fournisseur->enabled) && empty($conf->reception->enabled))
+ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled))
{
$result = $this->load_stats_reception(0, '4', 1);
if ($result < 0) dol_print_error($this->db, $this->error);
$stock_reception_fournisseur = $this->stats_reception['qty'];
}
- if (!empty($conf->fournisseur->enabled) && !empty($conf->reception->enabled))
+ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled))
{
$result = $this->load_stats_reception(0, '4', 1); // Use same tables than when module reception is not used.
if ($result < 0) dol_print_error($this->db, $this->error);
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index af12804aac5..1fa7dfb12a3 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -674,7 +674,8 @@ if ($id > 0 || $ref)
}
// Number of supplier order running
- if (!empty($conf->fournisseur->enabled)) {
+ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
+ {
if ($found) $helpondiff .= '
'; else $found = 1;
$result = $object->load_stats_commande_fournisseur(0, '3,4', 1);
$helpondiff .= $langs->trans("ProductQtyInSuppliersOrdersRunning").': '.$object->stats_commande_fournisseur['qty'];
@@ -684,7 +685,7 @@ if ($id > 0 || $ref)
}
// Number of product from supplier order already received (partial receipt)
- if (!empty($conf->fournisseur->enabled)) {
+ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
if ($found) $helpondiff .= '
'; else $found = 1;
$helpondiff .= $langs->trans("ProductQtyInSuppliersShipmentAlreadyRecevied").': '.$object->stats_reception['qty'];
}
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index 5b89c086c1f..f96082db62c 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -134,7 +134,7 @@ else
$statstring .= ''.$langs->trans("Customers").' | '.round($third['customer']).' | ';
$statstring .= "
";
}
- if (!empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire)
+ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire)
{
$statstring2 = "";
$statstring2 .= '| '.$langs->trans("Suppliers").' | '.round($third['supplier']).' | ';
@@ -310,7 +310,7 @@ if ($result)
$thirdparty_static->name = $langs->trans("Prospect");
print $thirdparty_static->getNomUrl(0, 'prospect', 0, 1);
}
- if (!empty($conf->fournisseur->enabled) && $thirdparty_static->fournisseur)
+ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $thirdparty_static->fournisseur)
{
if ($thirdparty_static->client) print " / ";
$thirdparty_static->name = $langs->trans("Supplier");
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 63641f27625..253de10fc58 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -178,9 +178,9 @@ $arrayfields = array(
's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>3, 'checked'=>1),
's.barcode'=>array('label'=>"Gencod", 'position'=>5, 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))),
's.code_client'=>array('label'=>"CustomerCodeShort", 'position'=>10, 'checked'=>$checkedcustomercode),
- 's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'position'=>11, 'checked'=>$checkedsuppliercode, 'enabled'=>(!empty($conf->fournisseur->enabled))),
+ 's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'position'=>11, 'checked'=>$checkedsuppliercode, 'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'position'=>13, 'checked'=>$checkedcustomeraccountcode),
- 's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'position'=>14, 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(!empty($conf->fournisseur->enabled))),
+ 's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'position'=>14, 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
's.town'=>array('label'=>"Town", 'position'=>20, 'checked'=>1),
's.zip'=>array('label'=>"Zip", 'position'=>21, 'checked'=>1),
'state.nom'=>array('label'=>"State", 'position'=>22, 'checked'=>0),
@@ -1226,7 +1226,7 @@ while ($i < min($num, $limit))
$companystatic->name_alias = '';
$s .= $companystatic->getNomUrl(0, 'prospect', 0, 1);
}
- if ((!empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) && $obj->fournisseur)
+ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur)
{
if ($s) $s .= ", ";
$companystatic->name = $langs->trans("Supplier");