diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 570ca0c2a5a..410c7170c30 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -356,7 +356,7 @@ if (!empty($conf->reception->enabled)) { print ''; print ''.$langs->trans("ReStockOnDispatchOrder").''; print ''; - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1); } else { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 61bacfb3e66..9e852d4a019 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2534,7 +2534,7 @@ if ($action == 'create') { // Create a purchase order if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) { - if (!empty($conf->fournisseur->enabled) && $object->statut == Propal::STATUS_SIGNED) { + if ($object->statut == Propal::STATUS_SIGNED && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { if ($usercancreatepurchaseorder) { print ''.$langs->trans("AddPurchaseOrder").''; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index df79a9edffd..fe279897f7a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1631,7 +1631,7 @@ if ($resql) { } $stock_order = $generic_product->stats_commande['qty']; } - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) { $generic_product->load_stats_commande_fournisseur(0, '3'); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty']; @@ -1653,7 +1653,7 @@ if ($resql) { } else { $text_info .= ''.$langs->trans('Available').' : '.$text_stock_reel.''; } - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { $text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'
'; } else { $text_info .= '
'; diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index d10324ef620..3395a21435c 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -68,7 +68,7 @@ if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADH $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || !empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { +if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { $arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 56873fe5470..632cfc0311f 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -432,7 +432,7 @@ class Conf $this->fournisseur->payment->dir_temp = $rootfortemp."/fournisseur/payment/temp"; // For backward compatibility // To prepare split of module fournisseur into module 'fournisseur' + supplier_order + supplier_invoice - if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) { // By default, if module supplier is on, and we don't use yet the new modules, we set artificialy the module properties + if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) { // By default, if module supplier is on, and we don't use yet the new modules, we set artificially the module properties $this->supplier_order = new stdClass(); $this->supplier_order->enabled = 1; $this->supplier_order->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 104655ee1da..62c53a8ac8b 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -9,7 +9,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__; -- table llx_menu -- insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || $conf->fournisseur->enabled || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', 16__+MAX_llx_menu__, __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 575f26542e2..cc34b2e5489 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -124,7 +124,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) ), - 'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire)), + 'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->supplier_invoice->lire) || !empty($user->rights->supplier_proposal->lire)), 'module'=>'societe|fournisseur' ); $menu_arr[] = array( diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index fd1c7cceca0..0cc1da3e52b 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -203,7 +203,7 @@ class modProduct extends DolibarrModules if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['p.recuperableonly'] = 'NPR'; } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (!empty($conf->stock->enabled)) { @@ -216,7 +216,7 @@ class modProduct extends DolibarrModules $keyforelement = 'product'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - 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)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('s.nom'=>'Supplier', 'pf.ref_fourn'=>'SupplierRef', 'pf.quantity'=>'QtyMin', 'pf.remise_percent'=>'DiscountQtyMin', 'pf.unitprice'=>'BuyingPrice', 'pf.delivery_time_days'=>'NbDaysToDelivery')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -250,7 +250,7 @@ class modProduct extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); } - 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)) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -269,7 +269,7 @@ class modProduct extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); } - 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)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -284,7 +284,7 @@ class modProduct extends DolibarrModules if (!empty($conf->barcode->enabled)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); } - 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)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -305,7 +305,7 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid'; } $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object'; - 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)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc'; } if (!empty($conf->stock->enabled)) { @@ -609,7 +609,7 @@ class modProduct extends DolibarrModules )); } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) { $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (is_object($mysoc) && $usenpr) { @@ -702,7 +702,7 @@ class modProduct extends DolibarrModules 'p.desiredstock' => '' )); } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) { $import_sample = array_merge($import_sample, array('p.cost_price'=>'90')); } if (is_object($mysoc) && $usenpr) { @@ -741,7 +741,7 @@ class modProduct extends DolibarrModules $this->import_updatekeys_array[$r] = array_merge($this->import_updatekeys_array[$r], array('p.barcode'=>'BarCode')); //only show/allow barcode as update key if Barcode module enabled } - 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)) { // Import suppliers prices (note: this code is duplicated in module Service) $r++; $this->import_code[$r] = $this->rights_class.'_supplierprices'; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 3b21cf046c8..9e79aee9663 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -168,7 +168,7 @@ class modService extends DolibarrModules if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['p.recuperableonly'] = 'NPR'; } - if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); } if (!empty($conf->stock->enabled)) { diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index f30709445b3..af4fb9e64b8 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -384,7 +384,7 @@ class modSociete extends DolibarrModules 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", 's.phone'=>"company", 's.email'=>"company", 't.libelle'=>"company" ); // We define here only fields that use another picto - 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)) { unset($this->export_fields_array[$r]['s.code_fournisseur']); unset($this->export_entities_array[$r]['s.code_fournisseur']); } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 091f26a0872..315336748be 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -964,13 +964,13 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListSupplierOrdersAssociatedProject", 'table' => 'commande_fournisseur', 'class' => 'CommandeFournisseur', - 'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire + 'test' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) ), 'invoice_supplier' => array( 'title' => "ListSupplierInvoicesAssociatedProject", 'table' => 'facture_fourn', 'class' => 'FactureFournisseur', - 'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire + 'test' => ((!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) ), 'contract' => array( 'title' => "ListContractAssociatedProject", diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index fc444babe0d..cd6c6789038 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -50,10 +50,10 @@ if (!empty($conf->facture->enabled)) { if (!empty($conf->commande->enabled)) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (!empty($conf->fournisseur->enabled)) { +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)) { +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)) { diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 4aa6db074f6..89d30f23c5f 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -879,7 +879,7 @@ class pdf_squille extends ModelePdfReception $origin_id = $object->origin_id; // TODO move to external function - if (!empty($conf->fournisseur->enabled)) { // commonly $origin='commande' + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { // commonly $origin='commande' $outputlangs->load('orders'); $classname = 'CommandeFournisseur'; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index fc626adbedb..6bbb6d441c8 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -192,7 +192,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // First classify billed the order to allow the proposal classify process - if (!empty($conf->fournisseur->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) { + 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->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) { $object->fetchObjectLinked('', 'order_supplier', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index fc0aeb3cd5e..08f94484e37 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -132,9 +132,9 @@ class InterfaceNotification extends DolibarrTriggers $element = $obj->elementtype; // Exclude events if related module is disabled - if ($element == 'order_supplier' && empty($conf->fournisseur->enabled)) { + if ($element == 'order_supplier' && (empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || empty($conf->supplier_order->enabled))) { $qualified = 0; - } elseif ($element == 'invoice_supplier' && empty($conf->fournisseur->enabled)) { + } elseif ($element == 'invoice_supplier' && (empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || empty($conf->supplier_invoice->enabled))) { $qualified = 0; } elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) { $qualified = 0; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index f20985d45fb..ebce9b94ad8 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -330,11 +330,11 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (!empty($conf->supplier_proposal->enabled)) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } - if (!empty($conf->fournisseur->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); } - if (!empty($conf->fournisseur->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index a665d57f1a3..2ef71544764 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -128,11 +128,11 @@ if (!empty($conf->facture->enabled)) { if (!empty($conf->supplier_proposal->enabled)) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } -if (!empty($conf->fournisseur->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); +if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); } -if (!empty($conf->fournisseur->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); +if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 294adb50146..bbc427e48df 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -406,7 +406,7 @@ if ($object->id > 0) { } } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { // Box proposals $tmp = $object->getOutstandingOrders('supplier'); $outstandingOpened = $tmp['opened']; @@ -427,7 +427,7 @@ if ($object->id > 0) { } } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) { $tmp = $object->getOutstandingBills('supplier'); $outstandingOpened = $tmp['opened']; $outstandingTotal = $tmp['total_ht']; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 0a03b367717..18c45507f0a 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2438,7 +2438,7 @@ if ($action == 'create') { } if (in_array($object->statut, array(3, 4, 5))) { - if ($conf->fournisseur->enabled && $usercanreceived) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $usercanreceived) { print '
'.$labelofbutton.'
'; } else { print '
'.$labelofbutton.'
'; @@ -2464,7 +2464,7 @@ if ($action == 'create') { // Create bill //if (! empty($conf->facture->enabled)) //{ - if (!empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled + 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) { print ''.$langs->trans("CreateBill").''; } diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 9164a223d04..48e45190beb 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -185,7 +185,7 @@ if ($resql) { * Draft orders */ -if (!empty($conf->fournisseur->enabled)) { +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 000b5def498..ecd572e1046 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -112,10 +112,10 @@ if ($user->socid) { // require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; // $object = new PaiementFourn($db); // restrictedArea($user, $object->element); -if (empty($conf->fournisseur->enabled)) { +if ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled)) { accessforbidden(); } -if (!$user->rights->fournisseur->facture->lire) { +if (!$user->rights->fournisseur->facture->lire || !$user->rights->supplier_invoice->lire) { accessforbidden(); } diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index b7970a58c80..b1c569c0912 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -120,7 +120,7 @@ if ($socid > 0) { print ''; } - 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)) { + if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print ''; print $langs->trans('SupplierCode').''; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 0aa39a53bb3..b23cfbc5c4c 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -682,7 +682,7 @@ if (!empty($conf->global->MAIN_MULTILANGS)) { print ''; } -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->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").''; print ''; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 16bbc508ac9..59fc743f8be 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5128,7 +5128,7 @@ class Product extends CommonObject } $stock_sending_client = $this->stats_expedition['qty']; } - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { $filterStatus = '1,2,3,4'; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,'.$filterStatus; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index dc035187f30..105e4408a68 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1579,7 +1579,7 @@ if ($resql) { //print price($obj->minsellprice).' '.$langs->trans("HT"); if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) { if ($product_fourn->product_fourn_price_id > 0) { - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { $htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1); print ''.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).''; } else { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index f6d77bdb6c0..b97e9b6c2d2 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -701,7 +701,7 @@ if ($id > 0 || $ref) { } // Number of supplier order running - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->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 { @@ -717,7 +717,7 @@ if ($id > 0 || $ref) { } // Number of product from supplier order already received (partial receipt) - if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->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 { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 393fbc73ae2..4c494732499 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -396,7 +396,7 @@ if ($usevirtualstock) { $sqlExpeditionsCli = '0'; } - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,"; $sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3"; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index a71d8c4a602..083f80f836d 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -50,10 +50,10 @@ if (!empty($conf->commande->enabled)) { if (!empty($conf->supplier_proposal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; } -if (!empty($conf->fournisseur->enabled)) { +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)) { +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)) { diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 1e78c6636ce..503ab235f95 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -50,7 +50,7 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -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.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; } @@ -745,7 +745,7 @@ if ($action == 'create') { // Ref print ''; - if ($origin == 'supplierorder' && !empty($conf->fournisseur->enabled)) { + if ($origin == 'supplierorder' && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$object->ref; } if ($origin == 'propal' && !empty($conf->propal->enabled)) { @@ -1270,7 +1270,7 @@ if ($action == 'create') { $objectsrc = new Propal($db); $objectsrc->fetch($object->$typeobject->id); } - if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && !empty($conf->fournisseur->enabled)) { + if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); } @@ -1982,7 +1982,7 @@ if ($action == 'create') { } // Create bill - if (!empty($conf->fournisseur->enabled) && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) { + 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) { // TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) // If we do that, we must also make this option official. @@ -1996,7 +1996,7 @@ if ($action == 'create') { if ($user->rights->reception->creer && $object->statut > 0 && !$object->billed) { $label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on receptions instead of orders - if (!empty($conf->fournisseur->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? $label = "ClassifyBilled"; $paramaction = 'classifybilled'; } diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 3caa9a90fea..c99b44074eb 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -56,7 +56,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($origin == 'order_supplier' && $object->$typeobject->id && !empty($conf->fournisseur->enabled)) { + if ($origin == 'order_supplier' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); } @@ -209,7 +209,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Linked documents - if ($origin == 'order_supplier' && $object->$typeobject->id && !empty($conf->fournisseur->enabled)) { + if ($origin == 'order_supplier' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) { print '
'; $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 53748c1465a..05c54a914b5 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -186,7 +186,7 @@ abstract class ActionsCardCommon $s = $modCodeClient->getToolTip($langs, $this->object, 0); $this->tpl['help_customercode'] = $form->textwithpicto('', $s, 1); - 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)) { $this->tpl['supplier_enabled'] = 1; // Load object modCodeFournisseur diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 68efa8e694c..97163231baa 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -980,7 +980,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (GETPOST("type") == 'p') { $object->client = 2; } - if (!empty($conf->fournisseur->enabled) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur = 1; } @@ -1282,7 +1282,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; print ''; - if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)) || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { // Supplier print ''; @@ -1300,11 +1300,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print ''; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ''; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print ''; // Supplier - if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { print ''; print ''; @@ -1975,7 +1975,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } print ''; @@ -2256,7 +2256,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ""; // Supplier - if (!empty($conf->fournisseur->enabled)) { + if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print ''; print ''; print ''; $statstring .= ""; } - 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) { + if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $statstring2 = ""; $statstring2 .= ''; $statstring2 .= ""; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index ad83579341d..c70e080528b 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -178,7 +178,7 @@ if ($result > 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 '
'; $tmpcode = $object->code_fournisseur; if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { @@ -1585,7 +1585,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier - 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 '
'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0); @@ -1964,7 +1964,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).'
'; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { + if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print '
'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); @@ -2460,7 +2460,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier code - if (!empty($conf->fournisseur->enabled) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print '
'; print $langs->trans('SupplierCode').''; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); @@ -2667,7 +2667,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier - if (!empty($conf->fournisseur->enabled) && $object->fournisseur) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print '
'.$langs->trans("SuppliersCategoriesShort").''; print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 3190ad5e64e..1ffd1563838 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -192,13 +192,13 @@ if ($object->fournisseur) { $obj = $db->fetch_object($resql); $nbCmdsFourn = $obj->nb; $thirdTypeArray['supplier'] = $langs->trans("supplier"); - if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) { + if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices'); } - if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) { + if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { $elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders'); } - if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) { + if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire) { $elementTypeArray['supplier_proposal'] = $langs->transnoentitiesnoconv('SupplierProposals'); } } diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index c87d260f23e..a8a4c454c2c 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -118,7 +118,7 @@ if ($result) { if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found = 1; $third['customer']++; } - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { + if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found = 1; $third['supplier']++; } if (!empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) { @@ -144,7 +144,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $dataseries[] = array($langs->trans("Customers"), round($third['customer'])); } - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { + if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $dataseries[] = array($langs->trans("Suppliers"), round($third['supplier'])); } if (!empty($conf->societe->enabled)) { @@ -171,7 +171,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + $statstring .= ''.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("Suppliers").''.round($third['supplier']).'
'; print $langs->trans('SupplierCode').''; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 92b43902405..e16a12581ac 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1859,7 +1859,7 @@ if ($action == 'create') { } // Create an order - if (!empty($conf->fournisseur->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $object->statut == SupplierProposal::STATUS_SIGNED) { if ($usercancreateorder) { print ''; }