Use isModEnabled
This commit is contained in:
parent
1dfcf8eceb
commit
6abca50afe
@ -107,7 +107,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
// Thirdparty
|
||||
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($permissiontoadd) {
|
||||
|
||||
@ -482,7 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}*/
|
||||
|
||||
$formquestion = array();
|
||||
if (!empty($conf->mrp->enabled)) {
|
||||
if (isModEnabled('mrp')) {
|
||||
$langs->load("mrp");
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -525,7 +525,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Thirdparty
|
||||
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($permissiontoadd) {
|
||||
|
||||
@ -313,7 +313,7 @@ if (empty($reshook)) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} else {
|
||||
if (!empty($conf->dynamicprices->enabled) && $price_expression !== '') {
|
||||
if (isModEnabled('dynamicprices') && $price_expression !== '') {
|
||||
//Check the expression validity by parsing it
|
||||
$priceparser = new PriceParser($db);
|
||||
$object->fk_supplier_price_expression = $price_expression;
|
||||
@ -323,7 +323,7 @@ if (empty($reshook)) {
|
||||
setEventMessages($priceparser->translatedError(), null, 'errors');
|
||||
}
|
||||
}
|
||||
if (!$error && !empty($conf->dynamicprices->enabled)) {
|
||||
if (!$error && isModEnabled('dynamicprices')) {
|
||||
//Set the price expression for this supplier price
|
||||
$ret = $object->setSupplierPriceExpression($price_expression);
|
||||
if ($ret < 0) {
|
||||
@ -635,7 +635,7 @@ if ($id > 0 || $ref) {
|
||||
print '<input type="text" class="flat" size="5" name="tva_tx" value="'.$vattosuggest.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
if (!empty($conf->dynamicprices->enabled)) { //Only show price mode and expression selector if module is enabled
|
||||
if (isModEnabled('dynamicprices')) { //Only show price mode and expression selector if module is enabled
|
||||
// Price mode selector
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PriceMode").'</td><td>';
|
||||
$price_expression = new PriceExpression($db);
|
||||
@ -803,7 +803,7 @@ END;
|
||||
|
||||
// Option to define a transport cost on supplier price
|
||||
if (!empty($conf->global->PRODUCT_CHARGES)) {
|
||||
if (!empty($conf->margin->enabled)) {
|
||||
if (isModEnabled('margin')) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Charges").'</td>';
|
||||
print '<td><input class="flat width75" name="charges" value="'.(GETPOST('charges') ? price(GETPOST('charges')) : (isset($object->fourn_charges) ? price($object->fourn_charges) : '')).'">';
|
||||
|
||||
@ -165,7 +165,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.
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user