Use isModEnabled
This commit is contained in:
parent
1edaa58d88
commit
8b093784ea
@ -445,7 +445,7 @@ if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|
||||
|| !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
|
||||
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)
|
||||
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)
|
||||
|| !empty($conf->mrp->enabled)) {
|
||||
|| isModEnabled('mrp')) {
|
||||
$virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs.
|
||||
}
|
||||
|
||||
|
||||
@ -570,7 +570,7 @@ function show_stats_for_company($product, $socid)
|
||||
}
|
||||
|
||||
// MO
|
||||
if (!empty($conf->mrp->enabled) && !empty($user->rights->mrp->read)) {
|
||||
if (isModEnabled('mrp') && !empty($user->rights->mrp->read)) {
|
||||
$nblines++;
|
||||
$ret = $product->load_stats_mo($socid);
|
||||
if ($ret < 0) {
|
||||
|
||||
@ -168,7 +168,7 @@ function project_prepare_head(Project $project, $moreparam = '')
|
||||
if (isModEnabled("expedition")) {
|
||||
$nbElements += $project->getElementCount('shipping', 'expedition');
|
||||
}
|
||||
if (!empty($conf->mrp->enabled)) {
|
||||
if (isModEnabled('mrp')) {
|
||||
$nbElements += $project->getElementCount('mrp', 'mrp_mo', 'fk_project');
|
||||
}
|
||||
if (isModEnabled('deplacement')) {
|
||||
|
||||
@ -159,7 +159,7 @@ if (isModEnabled('holiday')) {
|
||||
if (isModEnabled("banque")) {
|
||||
$langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
|
||||
}
|
||||
if (!empty($conf->mrp->enabled)) {
|
||||
if (isModEnabled('mrp')) {
|
||||
$langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>isModEnabled('mrp'), 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
|
||||
}
|
||||
if (isModEnabled('recruitment')) {
|
||||
|
||||
@ -5535,7 +5535,7 @@ class Product extends CommonObject
|
||||
}
|
||||
$stock_reception_fournisseur = $this->stats_reception['qty'];
|
||||
}
|
||||
if (!empty($conf->mrp->enabled)) {
|
||||
if (isModEnabled('mrp')) {
|
||||
$result = $this->load_stats_inproduction(0, '1,2', 1, $dateofvirtualstock);
|
||||
if ($result < 0) {
|
||||
dol_print_error($this->db, $this->error);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user