Use isModEnabled
This commit is contained in:
parent
8b093784ea
commit
a44dcdb562
@ -91,7 +91,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.
|
||||
}
|
||||
|
||||
|
||||
@ -821,7 +821,7 @@ if ($id > 0 || $ref) {
|
||||
}
|
||||
|
||||
// Number of product in production
|
||||
if (!empty($conf->mrp->enabled)) {
|
||||
if (isModEnabled('mrp')) {
|
||||
if ($found) {
|
||||
$helpondiff .= '<br>';
|
||||
} else {
|
||||
|
||||
@ -111,7 +111,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.
|
||||
}
|
||||
|
||||
@ -459,7 +459,7 @@ if ($usevirtualstock) {
|
||||
$sqlReceptionFourn = '0';
|
||||
}
|
||||
|
||||
if (!empty($conf->mrp->enabled)) {
|
||||
if (isModEnabled('mrp')) {
|
||||
$sqlProductionToConsume = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
|
||||
$sqlProductionToConsume .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,";
|
||||
$sqlProductionToConsume .= " ".MAIN_DB_PREFIX."mrp_production as mp5";
|
||||
|
||||
@ -99,7 +99,7 @@ if (!empty($conf->salaries->enabled)) {
|
||||
if (isModEnabled('categorie')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
}
|
||||
if (!empty($conf->mrp->enabled)) {
|
||||
if (isModEnabled('mrp')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ if (!empty($conf->loan->enabled)) {
|
||||
if (!empty($conf->salaries->enabled)) {
|
||||
$langs->load("salaries");
|
||||
}
|
||||
if (!empty($conf->mrp->enabled)) {
|
||||
if (isModEnabled('mrp')) {
|
||||
$langs->load("mrp");
|
||||
}
|
||||
if (isModEnabled('eventorganization')) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user