commit
a86aaff288
@ -68,7 +68,7 @@ $conditions = array(
|
||||
'USERSIGN' => 1,
|
||||
'MAILING' => isModEnabled('mailing'),
|
||||
'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')),
|
||||
'TICKET' => !empty($conf->ticket->enabled),
|
||||
'TICKET' => isModEnabled('ticket'),
|
||||
);
|
||||
// Picto
|
||||
$picto = array(
|
||||
|
||||
@ -207,7 +207,7 @@ if (isModEnabled("expedition")) {
|
||||
if (isModEnabled("reception")) {
|
||||
$elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception'));
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention'));
|
||||
}
|
||||
if (isModEnabled('supplier_proposal')) {
|
||||
@ -222,7 +222,7 @@ if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture->
|
||||
if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) {
|
||||
$elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract'));
|
||||
}
|
||||
if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) {
|
||||
if (isModEnabled('ticket') && !empty($user->rights->ticket->read)) {
|
||||
$elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket'));
|
||||
}
|
||||
if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) {
|
||||
|
||||
@ -75,7 +75,7 @@ $workflowcodes = array(
|
||||
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
|
||||
'family'=>'create',
|
||||
'position'=>25,
|
||||
'enabled'=>(!empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled)),
|
||||
'enabled'=>(isModEnabled('ticket') && isModEnabled('ficheinter')),
|
||||
'picto'=>'ticket'
|
||||
),
|
||||
|
||||
@ -133,7 +133,7 @@ $workflowcodes = array(
|
||||
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array(
|
||||
'family'=>'classify_supplier_order',
|
||||
'position'=>63,
|
||||
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
|
||||
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))),
|
||||
'picto'=>'supplier_order',
|
||||
'warning'=>''
|
||||
),
|
||||
@ -141,7 +141,7 @@ $workflowcodes = array(
|
||||
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array(
|
||||
'family'=>'classify_supplier_order',
|
||||
'position'=>64,
|
||||
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
|
||||
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))),
|
||||
'picto'=>'supplier_order',
|
||||
'warning'=>''
|
||||
),
|
||||
@ -174,13 +174,13 @@ $workflowcodes = array(
|
||||
'WORKFLOW_TICKET_LINK_CONTRACT' => array(
|
||||
'family' => 'link_ticket',
|
||||
'position' => 75,
|
||||
'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled),
|
||||
'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled),
|
||||
'picto' => 'ticket'
|
||||
),
|
||||
'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
|
||||
'family' => 'link_ticket',
|
||||
'position' => 76,
|
||||
'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled),
|
||||
'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled),
|
||||
'picto' => 'ticket'
|
||||
),
|
||||
);
|
||||
|
||||
@ -128,7 +128,7 @@ if ($object->id > 0) {
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = assetPrepareHead($object);
|
||||
|
||||
@ -130,7 +130,7 @@ if ($object->id > 0) {
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = assetModelPrepareHead($object);
|
||||
|
||||
@ -165,7 +165,7 @@ class BlockedLog
|
||||
*/
|
||||
|
||||
// Donation
|
||||
if (!empty($conf->don->enabled)) {
|
||||
if (isModEnabled('don')) {
|
||||
$this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE';
|
||||
$this->trackedevents['DON_DELETE'] = 'logDON_DELETE';
|
||||
//$this->trackedevents['DON_SENTBYMAIL']='logDON_SENTBYMAIL';
|
||||
|
||||
@ -130,7 +130,7 @@ if ($object->id > 0) {
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = bomPrepareHead($object);
|
||||
|
||||
@ -353,7 +353,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
$text = $langs->trans('ConfirmValidateBom', $numref);
|
||||
/*if (! empty($conf->notification->enabled))
|
||||
/*if (isModEnabled('notification'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
@ -362,7 +362,7 @@ if (empty($reshook)) {
|
||||
}*/
|
||||
|
||||
$formquestion = array();
|
||||
if (!empty($conf->bom->enabled)) {
|
||||
if (isModEnabled('bom')) {
|
||||
$langs->load("mrp");
|
||||
$forcecombo = 0;
|
||||
if ($conf->browser->name == 'ie') {
|
||||
@ -381,7 +381,7 @@ if (empty($reshook)) {
|
||||
// Confirmation of closing
|
||||
if ($action == 'close') {
|
||||
$text = $langs->trans('ConfirmCloseBom', $object->ref);
|
||||
/*if (! empty($conf->notification->enabled))
|
||||
/*if (isModEnabled('notification'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
@ -390,7 +390,7 @@ if (empty($reshook)) {
|
||||
}*/
|
||||
|
||||
$formquestion = array();
|
||||
if (!empty($conf->bom->enabled)) {
|
||||
if (isModEnabled('bom')) {
|
||||
$langs->load("mrp");
|
||||
$forcecombo = 0;
|
||||
if ($conf->browser->name == 'ie') {
|
||||
@ -409,7 +409,7 @@ if (empty($reshook)) {
|
||||
// Confirmation of reopen
|
||||
if ($action == 'reopen') {
|
||||
$text = $langs->trans('ConfirmReopenBom', $object->ref);
|
||||
/*if (! empty($conf->notification->enabled))
|
||||
/*if (isModEnabled('notification'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
@ -418,7 +418,7 @@ if (empty($reshook)) {
|
||||
}*/
|
||||
|
||||
$formquestion = array();
|
||||
if (!empty($conf->bom->enabled)) {
|
||||
if (isModEnabled('bom')) {
|
||||
$langs->load("mrp");
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$forcecombo = 0;
|
||||
|
||||
@ -60,7 +60,7 @@ if (isModEnabled('contrat')) {
|
||||
if (isModEnabled('adherent')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
}
|
||||
|
||||
@ -82,10 +82,10 @@ if (isModEnabled('facture')) {
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$langs->load("interventions");
|
||||
}
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
|
||||
@ -545,7 +545,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) {
|
||||
$langs->load('stocks');
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -1231,7 +1231,7 @@ if ($object->id > 0) {
|
||||
/*
|
||||
* Latest interventions
|
||||
*/
|
||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
|
||||
if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) {
|
||||
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate, f.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
@ -1564,7 +1564,7 @@ if ($object->id > 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddContract").'</a></div>';
|
||||
}
|
||||
|
||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status == 1) {
|
||||
if (isModEnabled('ficheinter') && $user->rights->ficheinter->creer && $object->status == 1) {
|
||||
$langs->load("fichinter");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddIntervention").'</a></div>';
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
|
||||
$supplierorderstatic = new CommandeFournisseur($db);
|
||||
}
|
||||
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$fichinterstatic = new Fichinter($db);
|
||||
}
|
||||
|
||||
@ -519,7 +519,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
|
||||
/*
|
||||
* Draft interventionals
|
||||
*/
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
|
||||
@ -55,7 +55,7 @@ if (isModEnabled('project')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
if (isModEnabled('variants')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||
}
|
||||
|
||||
@ -976,7 +976,7 @@ if (empty($reshook)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') {
|
||||
if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') {
|
||||
if ($combinations = GETPOST('combinations', 'array')) {
|
||||
//Check if there is a product with the given combination
|
||||
$prodcomb = new ProductCombination($db);
|
||||
@ -1696,7 +1696,7 @@ if ($action == 'create') {
|
||||
if ($soc->fk_warehouse > 0) {
|
||||
$warehouse_id = $soc->fk_warehouse;
|
||||
}
|
||||
if (!empty($conf->stock->enabled) && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
if (isModEnabled('stock') && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
|
||||
$warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
|
||||
}
|
||||
@ -1836,7 +1836,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">';
|
||||
@ -2209,7 +2209,7 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$formquestion = array_merge($formquestion, array(
|
||||
@ -2248,7 +2248,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
$text = $langs->trans('ConfirmValidateProp', $numref);
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
@ -2520,7 +2520,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
|
||||
$langs->load('stocks');
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -2880,7 +2880,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Create an intervention
|
||||
if (isModEnabled("service") && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) {
|
||||
if (isModEnabled("service") && isModEnabled('ficheinter') && $object->statut == Propal::STATUS_SIGNED) {
|
||||
if ($usercancreateintervention) {
|
||||
$langs->load("interventions");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddIntervention").'</a>';
|
||||
|
||||
@ -1095,7 +1095,7 @@ if ($resql) {
|
||||
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx'));
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
|
||||
@ -58,7 +58,7 @@ if (isModEnabled('project')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
if (isModEnabled('variants')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||
}
|
||||
|
||||
@ -66,10 +66,10 @@ if (!empty($conf->variants->enabled)) {
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('orders', 'sendings', 'companies', 'bills', 'propal', 'deliveries', 'products', 'other'));
|
||||
|
||||
if (!empty($conf->incoterm->enabled)) {
|
||||
if (isModEnabled('incoterm')) {
|
||||
$langs->load('incoterm');
|
||||
}
|
||||
if (!empty($conf->margin->enabled)) {
|
||||
if (isModEnabled('margin')) {
|
||||
$langs->load('margins');
|
||||
}
|
||||
if (isModEnabled('productbatch')) {
|
||||
@ -603,7 +603,7 @@ if (empty($reshook)) {
|
||||
$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) {
|
||||
} elseif ($action == 'set_incoterms' && isModEnabled('incoterm')) {
|
||||
// Set incoterm
|
||||
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
|
||||
if ($result < 0) {
|
||||
@ -724,7 +724,7 @@ if (empty($reshook)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') {
|
||||
if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') {
|
||||
if ($combinations = GETPOST('combinations', 'array')) {
|
||||
//Check if there is a product with the given combination
|
||||
$prodcomb = new ProductCombination($db);
|
||||
@ -1242,7 +1242,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (!$idwarehouse || $idwarehouse == -1) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
@ -1262,7 +1262,7 @@ if (empty($reshook)) {
|
||||
|
||||
if (
|
||||
GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms)
|
||||
&& !empty($conf->facture->enabled) && !empty($user->rights->facture->creer)
|
||||
&& isModEnabled('facture') && !empty($user->rights->facture->creer)
|
||||
) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
|
||||
@ -1336,7 +1336,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (!$idwarehouse || $idwarehouse == -1) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
@ -1384,7 +1384,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (!$idwarehouse || $idwarehouse == -1) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
@ -1705,7 +1705,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
if ($soc->fk_warehouse > 0) {
|
||||
$warehouse_id = $soc->fk_warehouse;
|
||||
}
|
||||
if (!empty($conf->stock->enabled) && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
if (isModEnabled('stock') && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
|
||||
$warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
|
||||
}
|
||||
@ -1838,7 +1838,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
}
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
|
||||
@ -2062,7 +2062,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
}
|
||||
|
||||
$text = $langs->trans('ConfirmValidateOrder', $numref);
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
@ -2077,7 +2077,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
}
|
||||
|
||||
$formquestion = array();
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
$langs->load("stocks");
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -2231,7 +2231,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
|
||||
$text = $langs->trans('ConfirmUnvalidateOrder', $object->ref);
|
||||
$formquestion = array();
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
$langs->load("stocks");
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -2270,7 +2270,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
|
||||
$text = $langs->trans('ConfirmCancelOrder', $object->ref);
|
||||
$formquestion = array();
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
$langs->load("stocks");
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -2483,7 +2483,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
}
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
$langs->load('stocks');
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -2827,7 +2827,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
}
|
||||
|
||||
// Create intervention
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$langs->load("interventions");
|
||||
|
||||
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
|
||||
|
||||
@ -514,7 +514,7 @@ class Commande extends CommonOrder
|
||||
|
||||
if (!$error) {
|
||||
// If stock is incremented on validate order, we must increment it
|
||||
if ($result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
|
||||
if ($result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
@ -642,7 +642,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
// If stock is decremented on validate order, we must reincrement it
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
|
||||
$result = 0;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
@ -827,7 +827,7 @@ class Commande extends CommonOrder
|
||||
dol_syslog(get_class($this)."::cancel", LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
// If stock is decremented on validate order, we must reincrement it
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
|
||||
@ -1305,7 +1305,7 @@ if ($resql) {
|
||||
print $langs->trans('ValidateInvoices');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
print $form->selectyesno('validate_invoices', 0, 1, 1);
|
||||
print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')';
|
||||
} else {
|
||||
@ -1371,7 +1371,7 @@ if ($resql) {
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
// If Stock is enabled
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
@ -2385,7 +2385,7 @@ if ($resql) {
|
||||
// Show shippable Icon (this creates subloops, so may be slow)
|
||||
if (!empty($arrayfields['shippable']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if (!empty($show_shippable_command) && !empty($conf->stock->enabled)) {
|
||||
if (!empty($show_shippable_command) && isModEnabled('stock')) {
|
||||
if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
|
||||
$generic_commande->getLinesArray(); // Load array ->lines
|
||||
$generic_commande->loadExpeditions(); // Load array ->expeditions
|
||||
|
||||
@ -601,7 +601,7 @@ if (isModEnabled('multicompany') && is_object($mc)) {
|
||||
print '<br>';
|
||||
|
||||
// Project filter
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
if (isModEnabled('projet')) {
|
||||
$formproject = new FormProjets($db);
|
||||
$langs->load('projects');
|
||||
print '<span class="marginrightonly">'.$langs->trans('Project').":</span>";
|
||||
|
||||
@ -4119,7 +4119,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
$text = $langs->trans('ConfirmValidateBill', $numref);
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
|
||||
@ -1012,7 +1012,7 @@ class Facture extends CommonInvoice
|
||||
// else we get the best supplier price
|
||||
if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) {
|
||||
$buyprice = $producttmp->cost_price;
|
||||
} elseif (!empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) {
|
||||
} elseif (isModEnabled('stock') && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) {
|
||||
$buyprice = $producttmp->pmp;
|
||||
} else {
|
||||
if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) {
|
||||
@ -2655,7 +2655,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
// If we decrease stock on invoice validation, we increase back if a warehouse id was provided
|
||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse != -1) {
|
||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse != -1) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
@ -3162,7 +3162,7 @@ class Facture extends CommonInvoice
|
||||
$result = $this->thirdparty->set_as_client();
|
||||
|
||||
// If active we decrement the main product and its components at invoice validation
|
||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse > 0) {
|
||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
@ -3475,7 +3475,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
// If we decrease stock on invoice validation, we increase back
|
||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ if ($object->thirdparty->client) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
|
||||
if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) {
|
||||
$elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions');
|
||||
}
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ if ($id > 0) {
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ if ($id) {
|
||||
}
|
||||
llxHeader('', $title);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = contact_prepare_head($object);
|
||||
|
||||
@ -138,7 +138,7 @@ if ($id > 0) {
|
||||
}
|
||||
llxHeader('', $title);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = contract_prepare_head($object);
|
||||
|
||||
@ -912,12 +912,12 @@ if ($action == 'remove_file') {
|
||||
if (!$error && $massaction == 'validate' && $permissiontoadd) {
|
||||
$objecttmp = new $objectclass($db);
|
||||
|
||||
if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($objecttmp->element == 'invoice_supplier' && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
|
||||
if ($objecttmp->element == 'invoice_supplier' && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors');
|
||||
$error++;
|
||||
|
||||
@ -64,7 +64,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
$this->db = $db;
|
||||
|
||||
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||
$tmpentry = array('enabled'=>((isModEnabled("product") || isModEnabled("service")) && !empty($conf->stock->enabled)), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock');
|
||||
$tmpentry = array('enabled'=>((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock');
|
||||
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
|
||||
$this->hidden = ($showmode != 1);
|
||||
}
|
||||
|
||||
@ -2313,7 +2313,7 @@ class Form
|
||||
}
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
|
||||
|
||||
if (!empty($conf->variants->enabled) && is_array($selected_combinations)) {
|
||||
if (isModEnabled('variants') && is_array($selected_combinations)) {
|
||||
// Code to automatically insert with javascript the select of attributes under the select of product
|
||||
// when a parent of variant has been selected.
|
||||
$out .= '
|
||||
@ -2944,7 +2944,7 @@ class Form
|
||||
if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
|
||||
$opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"';
|
||||
}
|
||||
if (!empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
||||
if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
||||
if (!empty($user->rights->stock->lire)) {
|
||||
if ($objp->stock > 0) {
|
||||
$opt .= ' class="product_line_stock_ok"';
|
||||
@ -3101,7 +3101,7 @@ class Form
|
||||
$outdefault_vat_code = $objp->default_vat_code;
|
||||
}
|
||||
|
||||
if (!empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
||||
if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
||||
if (!empty($user->rights->stock->lire)) {
|
||||
$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
|
||||
|
||||
@ -3486,7 +3486,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->stock->enabled) && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
||||
if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
||||
$novirtualstock = ($showstockinlist == 2);
|
||||
|
||||
if (!empty($user->rights->stock->lire)) {
|
||||
@ -8614,7 +8614,7 @@ class Form
|
||||
}
|
||||
} elseif ($objecttype == 'ficheinter') {
|
||||
$tplpath = 'fichinter';
|
||||
if (empty($conf->ficheinter->enabled)) {
|
||||
if (!isModEnabled('ficheinter')) {
|
||||
continue; // Do not show if module disabled
|
||||
}
|
||||
} elseif ($objecttype == 'invoice_supplier') {
|
||||
|
||||
@ -1026,7 +1026,7 @@ class FormCompany extends Form
|
||||
public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '', $allowempty = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->fournisseur->enabled)) {
|
||||
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && !isModEnabled('fournisseur')) {
|
||||
return '' ;
|
||||
}
|
||||
|
||||
|
||||
@ -1634,7 +1634,7 @@ class FormMail extends Form
|
||||
if (isModEnabled('adherent')) {
|
||||
$tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember';
|
||||
}
|
||||
if (!empty($conf->don->enabled)) {
|
||||
if (isModEnabled('don')) {
|
||||
$tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation';
|
||||
}
|
||||
if (isModEnabled('facture')) {
|
||||
@ -1651,7 +1651,7 @@ class FormMail extends Form
|
||||
if (isModEnabled('adherent')) {
|
||||
$tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember';
|
||||
}
|
||||
if (!empty($conf->don->enabled)) {
|
||||
if (isModEnabled('don')) {
|
||||
$tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation';
|
||||
}
|
||||
if (isModEnabled('facture')) {
|
||||
|
||||
@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object)
|
||||
}
|
||||
|
||||
// Related items
|
||||
if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
|
||||
if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || isModEnabled('ficheinter') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
|
||||
$head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id;
|
||||
$head[$tab][1] = $langs->trans("Referers");
|
||||
$head[$tab][2] = 'consumption';
|
||||
|
||||
@ -2948,7 +2948,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file)) {
|
||||
$accessallowed = 1;
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$original_file = $conf->stock->multidir_output[$entity].'/movement/'.$original_file;
|
||||
}
|
||||
} elseif ($modulepart == 'contract' && !empty($conf->contrat->multidir_output[$entity])) {
|
||||
|
||||
@ -157,7 +157,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (!empty($conf->stock->enabled) && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) {
|
||||
if (isModEnabled('stock') && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) {
|
||||
$langs->load("stocks");
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("OrderDispatch");
|
||||
|
||||
@ -7404,7 +7404,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
$substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/
|
||||
}
|
||||
// add variables subtitutions ticket
|
||||
if (!empty($conf->ticket->enabled) && (!is_object($object) || $object->element == 'ticket')) {
|
||||
if (isModEnabled('ticket') && (!is_object($object) || $object->element == 'ticket')) {
|
||||
$substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__';
|
||||
$substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__';
|
||||
$substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__';
|
||||
|
||||
@ -94,7 +94,7 @@ function product_prepare_head($object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) {
|
||||
if (isModEnabled('variants') && ($object->isProduct() || $object->isService())) {
|
||||
global $db;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||
@ -115,7 +115,7 @@ function product_prepare_head($object)
|
||||
}
|
||||
|
||||
if ($object->isProduct() || ($object->isService() && !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { // If physical product we can stock (or service with option)
|
||||
if (!empty($conf->stock->enabled) && $user->rights->stock->lire) {
|
||||
if (isModEnabled('stock') && $user->rights->stock->lire) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("Stock");
|
||||
$head[$h][2] = 'stock';
|
||||
@ -547,7 +547,7 @@ function show_stats_for_company($product, $socid)
|
||||
}
|
||||
|
||||
// BOM
|
||||
if (!empty($conf->bom->enabled) && $user->rights->bom->read) {
|
||||
if (isModEnabled('bom') && $user->rights->bom->read) {
|
||||
$nblines++;
|
||||
$ret = $product->load_stats_bom($socid);
|
||||
if ($ret < 0) {
|
||||
|
||||
@ -127,7 +127,7 @@ function project_prepare_head(Project $project, $moreparam = '')
|
||||
if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))
|
||||
|| isModEnabled("propal") || isModEnabled('commande')
|
||||
|| isModEnabled('facture') || isModEnabled('contrat')
|
||||
|| !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) {
|
||||
|| isModEnabled('ficheinter') || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) {
|
||||
$nbElements = 0;
|
||||
// Enable caching of thirdrparty count Contacts
|
||||
$cachekey = 'count_elements_project_'.$project->id;
|
||||
@ -135,7 +135,7 @@ function project_prepare_head(Project $project, $moreparam = '')
|
||||
if (!is_null($dataretrieved)) {
|
||||
$nbElements = $dataretrieved;
|
||||
} else {
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$nbElements += $project->getElementCount('stock', 'entrepot', 'fk_project');
|
||||
}
|
||||
if (isModEnabled("propal")) {
|
||||
@ -162,7 +162,7 @@ function project_prepare_head(Project $project, $moreparam = '')
|
||||
if (isModEnabled('contrat')) {
|
||||
$nbElements += $project->getElementCount('contract', 'contrat');
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$nbElements += $project->getElementCount('intervention', 'fichinter');
|
||||
}
|
||||
if (isModEnabled("expedition")) {
|
||||
@ -177,7 +177,7 @@ function project_prepare_head(Project $project, $moreparam = '')
|
||||
if (isModEnabled('expensereport')) {
|
||||
$nbElements += $project->getElementCount('expensereport', 'expensereport');
|
||||
}
|
||||
if (!empty($conf->don->enabled)) {
|
||||
if (isModEnabled('don')) {
|
||||
$nbElements += $project->getElementCount('donation', 'don');
|
||||
}
|
||||
if (!empty($conf->loan->enabled)) {
|
||||
@ -189,7 +189,7 @@ function project_prepare_head(Project $project, $moreparam = '')
|
||||
if (isModEnabled('project')) {
|
||||
$nbElements += $project->getElementCount('project_task', 'projet_task');
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$nbElements += $project->getElementCount('stock_mouvement', 'stock');
|
||||
}
|
||||
if (!empty($conf->salaries->enabled)) {
|
||||
|
||||
@ -276,7 +276,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
|
||||
print '<td class="center">'.$langs->trans("DateCreation").'</td>';
|
||||
print '<td class="center">'.$langs->trans("DateDeliveryPlanned").'</td>';
|
||||
print '<td class="center">'.$langs->trans("QtyPreparedOrShipped").'</td>';
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td>'.$langs->trans("Warehouse").'</td>';
|
||||
}
|
||||
/*TODO Add link to expeditiondet_batch
|
||||
@ -385,7 +385,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
|
||||
print '<td class="center">'.$objp->qty_shipped.'</td>';
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td>';
|
||||
if ($objp->warehouse_id > 0) {
|
||||
$warehousestatic->fetch($objp->warehouse_id);
|
||||
|
||||
@ -107,7 +107,7 @@ function user_prepare_head(User $object)
|
||||
}
|
||||
|
||||
// Notifications
|
||||
if ($user->socid == 0 && !empty($conf->notification->enabled)) {
|
||||
if ($user->socid == 0 && isModEnabled('notification')) {
|
||||
$nbNote = 0;
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n";
|
||||
|
||||
@ -162,7 +162,7 @@ class modBanque extends DolibarrModules
|
||||
"s.nom"=>"company", "s.code_compta"=>"company", "s.code_compta_fournisseur"=>"company"
|
||||
);
|
||||
$this->export_special_array[$r] = array('-b.amount'=>'NULLIFNEG', 'b.amount'=>'NULLIFNEG');
|
||||
if ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled) || empty($conf->supplier_invoice->enabled)) {
|
||||
if ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order') || !isModEnabled('supplier_invoice')) {
|
||||
unset($this->export_fields_array[$r]['s.code_compta_fournisseur']);
|
||||
unset($this->export_entities_array[$r]['s.code_compta_fournisseur']);
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ class modCategorie extends DolibarrModules
|
||||
if (!empty($conf->bank->enabled)) {
|
||||
$typeexample .= ($typeexample ? " / " : "")."8=Bank line";
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$typeexample .= ($typeexample ? " / " : "")."9=Warehouse";
|
||||
}
|
||||
if (isModEnabled('agenda')) {
|
||||
@ -180,7 +180,7 @@ class modCategorie extends DolibarrModules
|
||||
$this->export_code[$r] = $this->rights_class.'_0_'.Categorie::$MAP_ID_TO_CODE[0];
|
||||
$this->export_label[$r] = 'CatProdList';
|
||||
$this->export_icon[$r] = $this->picto;
|
||||
$this->export_enabled[$r] = 'isModEnabled("product") || !empty($conf->service->enabled)';
|
||||
$this->export_enabled[$r] = 'isModEnabled("product") || isModEnabled("service")';
|
||||
$this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export"));
|
||||
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label');
|
||||
$this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.label'=>'Text');
|
||||
|
||||
@ -214,7 +214,7 @@ class modProduct extends DolibarrModules
|
||||
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !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)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('e.ref'=>'DefaultWarehouse', 'p.tobatch'=>'ManageLotSerial', 'p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -252,7 +252,7 @@ class modProduct extends DolibarrModules
|
||||
'p.tva_tx'=>'Numeric',
|
||||
'p.datec'=>'Date', 'p.tms'=>'Date'
|
||||
);
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('e.ref'=>'Text', 'p.tobatch'=>'Numeric', 'p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -271,7 +271,7 @@ class modProduct extends DolibarrModules
|
||||
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array("group_concat(cat.label)"=>'category'));
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -286,7 +286,7 @@ class modProduct extends DolibarrModules
|
||||
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
|
||||
$this->export_dependencies_array[$r] = array('category'=>'p.rowid');
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -316,7 +316,7 @@ class modProduct extends DolibarrModules
|
||||
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
|
||||
$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)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON e.rowid = p.fk_default_warehouse';
|
||||
}
|
||||
$this->export_sql_end[$r] .= ' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')';
|
||||
@ -409,7 +409,7 @@ class modProduct extends DolibarrModules
|
||||
'p.price_base_type'=>"PriceBase", 'p.price'=>"UnitPriceHT", 'p.price_ttc'=>"UnitPriceTTC", 'p.tva_tx'=>'VATRate', 'p.tosell'=>"OnSell",
|
||||
'p.tobuy'=>"OnBuy", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification'
|
||||
);
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -425,7 +425,7 @@ class modProduct extends DolibarrModules
|
||||
'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean",
|
||||
'p.datec'=>'Date', 'p.tms'=>'Date'
|
||||
);
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -441,7 +441,7 @@ class modProduct extends DolibarrModules
|
||||
'p.price_base_type'=>"virtualproduct", 'p.price'=>"virtualproduct", 'p.price_ttc'=>"virtualproduct", 'p.tva_tx'=>"virtualproduct",
|
||||
'p.tosell'=>"virtualproduct", 'p.tobuy'=>"virtualproduct", 'p.datec'=>"virtualproduct", 'p.tms'=>"virtualproduct"
|
||||
);
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -601,7 +601,7 @@ class modProduct extends DolibarrModules
|
||||
'p.recuperableonly' => '^[0|1]$',
|
||||
);
|
||||
|
||||
if (!empty($conf->stock->enabled)) {//if Stock module enabled
|
||||
if (isModEnabled('stock')) {//if Stock module enabled
|
||||
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
|
||||
'p.fk_default_warehouse'=>'DefaultWarehouse',
|
||||
'p.tobatch'=>'ManageLotSerial',
|
||||
@ -710,7 +710,7 @@ class modProduct extends DolibarrModules
|
||||
'p.finished' => '0 (raw material) / 1 (finished goods), matches field "code" in dictionary table "'.MAIN_DB_PREFIX.'c_product_nature"'
|
||||
);
|
||||
//clauses copied from import_fields_array
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$import_sample = array_merge($import_sample, array(
|
||||
'p.tobatch'=>"0 (don't use) / 1 (use batch) / 2 (use serial number)",
|
||||
'p.seuil_stock_alerte' => '',
|
||||
|
||||
@ -179,7 +179,7 @@ class modService extends DolibarrModules
|
||||
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !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)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -215,7 +215,7 @@ class modService extends DolibarrModules
|
||||
'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric',
|
||||
'p.datec'=>'Date', 'p.tms'=>'Date'
|
||||
);
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -234,7 +234,7 @@ class modService extends DolibarrModules
|
||||
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array("group_concat(cat.label)"=>'category'));
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -249,7 +249,7 @@ class modService extends DolibarrModules
|
||||
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
|
||||
$this->export_dependencies_array[$r] = array('category'=>'p.rowid');
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -368,7 +368,7 @@ class modService extends DolibarrModules
|
||||
'p.price_base_type'=>"PriceBase", 'p.price'=>"UnitPriceHT", 'p.price_ttc'=>"UnitPriceTTC", 'p.tva_tx'=>'VATRate', 'p.tosell'=>"OnSell",
|
||||
'p.tobuy'=>"OnBuy", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification'
|
||||
);
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -384,7 +384,7 @@ class modService extends DolibarrModules
|
||||
'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean",
|
||||
'p.datec'=>'Date', 'p.tms'=>'Date'
|
||||
);
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -400,7 +400,7 @@ class modService extends DolibarrModules
|
||||
'p.price_base_type'=>"virtualproduct", 'p.price'=>"virtualproduct", 'p.price_ttc'=>"virtualproduct", 'p.tva_tx'=>"virtualproduct",
|
||||
'p.tosell'=>"virtualproduct", 'p.tobuy'=>"virtualproduct", 'p.datec'=>"virtualproduct", 'p.tms'=>"virtualproduct"
|
||||
);
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct'));
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
@ -548,7 +548,7 @@ class modService extends DolibarrModules
|
||||
'p.recuperableonly' => '^[0|1]$',
|
||||
);
|
||||
|
||||
if (!empty($conf->stock->enabled)) {//if Stock module enabled
|
||||
if (isModEnabled('stock')) {//if Stock module enabled
|
||||
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
|
||||
'p.fk_default_warehouse'=>'DefaultWarehouse',
|
||||
'p.tobatch'=>'ManageLotSerial',
|
||||
@ -656,7 +656,7 @@ class modService extends DolibarrModules
|
||||
'p.finished' => '0 (raw material) / 1 (finished goods), matches field "code" in dictionary table "'.MAIN_DB_PREFIX.'c_product_nature"'
|
||||
);
|
||||
//clauses copied from import_fields_array
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$import_sample = array_merge($import_sample, array(
|
||||
'p.seuil_stock_alerte' => '',
|
||||
'p.pmp' => '0',
|
||||
|
||||
@ -413,7 +413,7 @@ class modSociete extends DolibarrModules
|
||||
't.libelle'=>"company",
|
||||
's.entity'=>'company',
|
||||
); // We define here only fields that use another picto
|
||||
if (empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
|
||||
if (!isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
|
||||
unset($this->export_fields_array[$r]['s.code_fournisseur']);
|
||||
unset($this->export_entities_array[$r]['s.code_fournisseur']);
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
|
||||
if (isModEnabled('contrat')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
}
|
||||
if (isModEnabled('deplacement')) {
|
||||
|
||||
@ -59,7 +59,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
|
||||
if (isModEnabled('contrat')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
}
|
||||
if (isModEnabled('deplacement')) {
|
||||
|
||||
@ -41,7 +41,7 @@ if (empty($object) || !is_object($object)) {
|
||||
exit;
|
||||
}
|
||||
$usemargins = 0;
|
||||
if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande'))) {
|
||||
if (isModEnabled('margin') && !empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande'))) {
|
||||
$usemargins = 1;
|
||||
}
|
||||
if (!isset($dateSelector)) {
|
||||
@ -184,7 +184,7 @@ if ($nolinesbefore) {
|
||||
$freelines = true;
|
||||
$forceall = 1; // We always force all type for free lines (module product or service means we use predefined product or service)
|
||||
if ($object->element == 'contrat') {
|
||||
if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) {
|
||||
if (!isModEnabled('product') && !isModEnabled('service') && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) {
|
||||
$forceall = -1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set
|
||||
} elseif (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) {
|
||||
$forceall = 3;
|
||||
@ -196,7 +196,7 @@ if ($nolinesbefore) {
|
||||
if ($forceall >= 0 && (isModEnabled("product") || isModEnabled("service"))) {
|
||||
echo '<label for="prod_entry_mode_free">';
|
||||
echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
|
||||
//echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked':'') );
|
||||
//echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (!isModEnabled('product') || !isModEnabled('service')))?' checked':'') );
|
||||
echo ((GETPOST('prod_entry_mode', 'alpha') == 'free' || !empty($conf->global->MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT)) ? ' checked' : '');
|
||||
echo '> ';
|
||||
// Show type selector
|
||||
@ -207,7 +207,7 @@ if ($nolinesbefore) {
|
||||
echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">';
|
||||
// Show type selector
|
||||
if ($forceall >= 0) {
|
||||
if (empty($conf->product->enabled) || empty($conf->service->enabled)) {
|
||||
if (!isModEnabled('product') || !isModEnabled('service')) {
|
||||
echo $langs->trans("Type");
|
||||
} else {
|
||||
echo $langs->trans("FreeLineOfType");
|
||||
@ -230,17 +230,17 @@ if ($nolinesbefore) {
|
||||
$labelforradio = '';
|
||||
if (empty($conf->dol_optimize_smallscreen)) {
|
||||
if (empty($senderissupplier)) {
|
||||
if (isModEnabled("product") && empty($conf->service->enabled)) {
|
||||
if (isModEnabled("product") && !isModEnabled('service')) {
|
||||
$labelforradio = $langs->trans('PredefinedProductsToSell');
|
||||
} elseif ((empty($conf->product->enabled) && isModEnabled("service")) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) {
|
||||
} elseif ((!isModEnabled('product') && isModEnabled('service')) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) {
|
||||
$labelforradio = $langs->trans('PredefinedServicesToSell');
|
||||
} else {
|
||||
$labelforradio = $langs->trans('PredefinedProductsAndServicesToSell');
|
||||
}
|
||||
} else {
|
||||
if (isModEnabled("product") && empty($conf->service->enabled)) {
|
||||
if (isModEnabled("product") && !isModEnabled('service')) {
|
||||
$labelforradio = $langs->trans('PredefinedProductsToPurchase');
|
||||
} elseif (empty($conf->product->enabled) && isModEnabled("service")) {
|
||||
} elseif (!isModEnabled('product') && isModEnabled('service')) {
|
||||
$labelforradio = $langs->trans('PredefinedServicesToPurchase');
|
||||
} else {
|
||||
$labelforradio = $langs->trans('PredefinedProductsAndServicesToPurchase');
|
||||
@ -338,7 +338,7 @@ if ($nolinesbefore) {
|
||||
}
|
||||
if (isModEnabled("product") || isModEnabled("service")) {
|
||||
echo '<br>';
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
if (isModEnabled('variants')) {
|
||||
echo '<div id="attributes_box"></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ if (isModEnabled('adherent')) {
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
if (!empty($conf->don->enabled)) {
|
||||
if (isModEnabled('don')) {
|
||||
print '<div id="donation"></div>';
|
||||
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnDonation", $servicename).':</span><br>';
|
||||
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'donation')."</strong><br>\n";
|
||||
|
||||
@ -433,7 +433,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
if ($action == 'TICKET_CREATE') {
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
// Auto link contract
|
||||
if (!empty($conf->contract->enabled) && !empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) {
|
||||
if (!empty($conf->contract->enabled) && isModEnabled('ticket') && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) {
|
||||
$societe = new Societe($this->db);
|
||||
$company_ids = (empty($conf->global->WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS)) ? [$object->fk_soc] : $societe->getParentsForCompany($object->fk_soc, [$object->fk_soc]);
|
||||
|
||||
@ -463,7 +463,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
}
|
||||
}
|
||||
// Automatically create intervention
|
||||
if (!empty($conf->ficheinter->enabled) && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) {
|
||||
if (isModEnabled('ficheinter') && isModEnabled('ticket') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) {
|
||||
$fichinter = new Fichinter($this->db);
|
||||
$fichinter->socid = (int) $object->fk_soc;
|
||||
$fichinter->fk_project = $projectid;
|
||||
|
||||
@ -66,7 +66,7 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
*/
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
if (empty($conf->notification) || empty($conf->notification->enabled)) {
|
||||
if (empty($conf->notification) || !isModEnabled('notification')) {
|
||||
return 0; // Module not active, we do nothing
|
||||
}
|
||||
|
||||
@ -135,9 +135,9 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
$element = $obj->elementtype;
|
||||
|
||||
// Exclude events if related module is disabled
|
||||
if ($element == 'order_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))) {
|
||||
if ($element == 'order_supplier' && ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))) {
|
||||
$qualified = 0;
|
||||
} elseif ($element == 'invoice_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled))) {
|
||||
} elseif ($element == 'invoice_supplier' && ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_invoice'))) {
|
||||
$qualified = 0;
|
||||
} elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) {
|
||||
$qualified = 0;
|
||||
|
||||
@ -61,7 +61,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
||||
{
|
||||
$ok = 0;
|
||||
|
||||
if (empty($conf->ticket) || empty($conf->ticket->enabled)) {
|
||||
if (empty($conf->ticket) || !isModEnabled('ticket')) {
|
||||
return 0; // Module not active, we do nothing
|
||||
}
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
|
||||
if (!empty($conf->expedition_bon->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||
}
|
||||
if (isModEnabled('project')) {
|
||||
@ -104,7 +104,7 @@ if ($action == 'add') {
|
||||
$object->commande_id = GETPOST("commande_id", 'int');
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
|
||||
if (!$conf->expedition_bon->enabled && !empty($conf->stock->enabled)) {
|
||||
if (!$conf->expedition_bon->enabled && isModEnabled('stock')) {
|
||||
$expedition->entrepot_id = GETPOST('entrepot_id', 'int');
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ if ($action == 'create') {
|
||||
print '<td colspan="3">'.$object->getLibStatut(4)."</td>\n";
|
||||
print '</tr>';*/
|
||||
|
||||
if (!$conf->expedition_bon->enabled && !empty($conf->stock->enabled)) {
|
||||
if (!$conf->expedition_bon->enabled && isModEnabled('stock')) {
|
||||
// Entrepot
|
||||
$entrepot = new Entrepot($db);
|
||||
$entrepot->fetch($object->entrepot_id);
|
||||
|
||||
@ -91,7 +91,7 @@ print load_fiche_titre($langs->trans("DonationsArea"), '', 'object_donation');
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // TODO Add a search into global search combo so we can remove this
|
||||
if (!empty($conf->don->enabled) && $user->rights->don->lire) {
|
||||
if (isModEnabled('don') && $user->rights->don->lire) {
|
||||
$listofsearchfields['search_donation'] = array('text'=>'Donation');
|
||||
}
|
||||
|
||||
|
||||
@ -352,7 +352,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
||||
$rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
|
||||
$rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$langs->load("interventions");
|
||||
$rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ if (isModEnabled('tax')) {
|
||||
if (isModEnabled('project')) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
|
||||
}
|
||||
if (isModEnabled('expensereport')) {
|
||||
|
||||
@ -391,7 +391,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
} elseif (!$error) {
|
||||
$labelfieldmissing = $langs->transnoentitiesnoconv("QtyToShip");
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$labelfieldmissing .= '/'.$langs->transnoentitiesnoconv("Warehouse");
|
||||
}
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $labelfieldmissing), null, 'errors');
|
||||
@ -739,7 +739,7 @@ if (empty($reshook)) {
|
||||
unset($_POST[$qty]);
|
||||
}
|
||||
}
|
||||
} elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
|
||||
} elseif (!isModEnabled('stock') && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
|
||||
$qty = "qtyl".$line_id;
|
||||
$line->id = $line_id;
|
||||
$line->qty = GETPOST($qty, 'int');
|
||||
@ -865,7 +865,7 @@ if ($action == 'create') {
|
||||
$author = new User($db);
|
||||
$author->fetch($object->user_author_id);
|
||||
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$entrepot = new Entrepot($db);
|
||||
}
|
||||
|
||||
@ -1077,7 +1077,7 @@ if ($action == 'create') {
|
||||
}
|
||||
print '<span id="autoreset" class="opacitymedium link cursor cursorpointer">'.img_picto($langs->trans("Reset"), 'eraser').'</span>';
|
||||
print '</td>';
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
if (empty($conf->productbatch->enabled)) {
|
||||
print '<td class="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>';
|
||||
} else {
|
||||
@ -1212,7 +1212,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
$warehouseObject = null;
|
||||
if (count($warehousePicking) == 1 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
|
||||
if (count($warehousePicking) == 1 || !($line->fk_product > 0) || !isModEnabled('stock')) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
|
||||
print '<!-- Case warehouse already known or product not a predefined product -->';
|
||||
//ship from preselected location
|
||||
$stock = + (isset($product->stock_warehouse[$warehouse_id]->real) ? $product->stock_warehouse[$warehouse_id]->real : 0); // Convert to number
|
||||
@ -1240,7 +1240,7 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
|
||||
// Stock
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="left">';
|
||||
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Type of product need stock change ?
|
||||
// Show warehouse combo list
|
||||
@ -1423,7 +1423,7 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
|
||||
// Stock
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="left">';
|
||||
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
print $tmpwarehouseObject->getNomUrl(0).' ';
|
||||
@ -1693,7 +1693,7 @@ if ($action == 'create') {
|
||||
|
||||
$text = $langs->trans("ConfirmValidateSending", $numref);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
@ -2045,7 +2045,7 @@ if ($action == 'create') {
|
||||
}
|
||||
if ($action == 'editline') {
|
||||
$editColspan = 3;
|
||||
if (empty($conf->stock->enabled)) {
|
||||
if (!isModEnabled('stock')) {
|
||||
$editColspan--;
|
||||
}
|
||||
if (empty($conf->productbatch->enabled)) {
|
||||
@ -2057,7 +2057,7 @@ if ($action == 'create') {
|
||||
} else {
|
||||
print $langs->trans("QtyShipped").' - ';
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print $langs->trans("WarehouseSource").' - ';
|
||||
}
|
||||
if (isModEnabled('productbatch')) {
|
||||
@ -2070,7 +2070,7 @@ if ($action == 'create') {
|
||||
} else {
|
||||
print '<td class="center linecolqtyshipped">'.$langs->trans("QtyShipped").'</td>';
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="left linecolwarehousesource">'.$langs->trans("WarehouseSource").'</td>';
|
||||
}
|
||||
|
||||
@ -2255,7 +2255,7 @@ if ($action == 'create') {
|
||||
print $shipment_static->getNomUrl(1);
|
||||
print ' - '.$shipmentline_var['qty_shipped'];
|
||||
$htmltext = $langs->trans("DateValidation").' : '.(empty($shipmentline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($shipmentline_var['date_valid'], 'dayhour'));
|
||||
if (!empty($conf->stock->enabled) && $shipmentline_var['warehouse'] > 0) {
|
||||
if (isModEnabled('stock') && $shipmentline_var['warehouse'] > 0) {
|
||||
$warehousestatic->fetch($shipmentline_var['warehouse']);
|
||||
$htmltext .= '<br>'.$langs->trans("FromLocation").' : '.$warehousestatic->getNomUrl(1, '', 0, 1);
|
||||
}
|
||||
@ -2292,7 +2292,7 @@ if ($action == 'create') {
|
||||
// Batch number managment
|
||||
print '<td>'.$formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product).'</td>';
|
||||
print '</tr>';
|
||||
} elseif (!empty($conf->stock->enabled)) {
|
||||
} elseif (isModEnabled('stock')) {
|
||||
if ($lines[$i]->fk_product > 0) {
|
||||
if ($lines[$i]->entrepot_id > 0) {
|
||||
print '<!-- case edit 2 -->';
|
||||
@ -2331,7 +2331,7 @@ if ($action == 'create') {
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
} elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
|
||||
} elseif (!isModEnabled('stock') && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
|
||||
print '<!-- case edit 6 -->';
|
||||
print '<tr>';
|
||||
// Qty to ship or shipped
|
||||
@ -2349,7 +2349,7 @@ if ($action == 'create') {
|
||||
print '<td class="linecolqtytoship center">'.$lines[$i]->qty_shipped.' '.$unit_order.'</td>';
|
||||
|
||||
// Warehouse source
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="linecolwarehousesource left">';
|
||||
if ($lines[$i]->entrepot_id > 0) {
|
||||
$entrepot = new Entrepot($db);
|
||||
@ -2452,7 +2452,7 @@ if ($action == 'create') {
|
||||
if (isModEnabled('productbatch')) {
|
||||
$colspan++;
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$colspan++;
|
||||
}
|
||||
|
||||
|
||||
@ -707,7 +707,7 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
// If stock increment is done on sending (recommanded choice)
|
||||
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
|
||||
if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
|
||||
$langs->load("agenda");
|
||||
@ -913,7 +913,7 @@ class Expedition extends CommonObject
|
||||
$line->rang = $orderline->rang;
|
||||
$line->product_type = $orderline->product_type;
|
||||
|
||||
if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) {
|
||||
if (isModEnabled('stock') && !empty($orderline->fk_product)) {
|
||||
$fk_product = $orderline->fk_product;
|
||||
|
||||
if (!($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS)) {
|
||||
@ -2150,7 +2150,7 @@ class Expedition extends CommonObject
|
||||
$this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback
|
||||
|
||||
// If stock increment is done on closing
|
||||
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
|
||||
$langs->load("agenda");
|
||||
@ -2327,7 +2327,7 @@ class Expedition extends CommonObject
|
||||
$this->billed = 0;
|
||||
|
||||
// If stock increment is done on closing
|
||||
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
|
||||
$langs->load("agenda");
|
||||
|
||||
@ -38,7 +38,7 @@ if (isModEnabled('project')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||
}
|
||||
if (isModEnabled("propal")) {
|
||||
@ -431,7 +431,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '</tr>';
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
print '<tr><td>';
|
||||
@ -642,7 +642,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '<th class="center">'.$langs->trans("QtyOrdered").'</th>';
|
||||
print '<th class="center">'.$langs->trans("QtyShipped").'</th>';
|
||||
print '<th class="center">'.$langs->trans("KeepToShip").'</th>';
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<th class="center">'.$langs->trans("RealStock").'</th>';
|
||||
} else {
|
||||
print '<th> </th>';
|
||||
@ -794,7 +794,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$product->load_stock('warehouseopen');
|
||||
}
|
||||
|
||||
if ($objp->fk_product > 0 && ($type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && !empty($conf->stock->enabled)) {
|
||||
if ($objp->fk_product > 0 && ($type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && isModEnabled('stock')) {
|
||||
print '<td class="center">';
|
||||
print $product->stock_reel;
|
||||
if ($product->stock_reel < $toBeShipped[$objp->fk_product]) {
|
||||
@ -858,7 +858,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
// Bouton expedier sans gestion des stocks
|
||||
if (empty($conf->stock->enabled) && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) {
|
||||
if (!isModEnabled('stock') && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) {
|
||||
if ($user->rights->expedition->creer) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/card.php?action=create&origin=commande&object_id='.$id.'">'.$langs->trans("CreateShipment").'</a>';
|
||||
if ($toBeShippedTotal <= 0) {
|
||||
@ -874,11 +874,11 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
// Bouton expedier avec gestion des stocks
|
||||
|
||||
if (!empty($conf->stock->enabled) && $object->statut == Commande::STATUS_DRAFT) {
|
||||
if (isModEnabled('stock') && $object->statut == Commande::STATUS_DRAFT) {
|
||||
print $langs->trans("ValidateOrderFirstBeforeShipment");
|
||||
}
|
||||
|
||||
if (!empty($conf->stock->enabled) && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) {
|
||||
if (isModEnabled('stock') && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) {
|
||||
if ($user->rights->expedition->creer) {
|
||||
//print load_fiche_titre($langs->trans("CreateShipment"));
|
||||
print '<div class="tabsAction">';
|
||||
@ -896,7 +896,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
//print '<tr>';
|
||||
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
//print '<td>';
|
||||
print $langs->trans("WarehouseSource");
|
||||
//print '</td>';
|
||||
|
||||
@ -170,7 +170,7 @@ if ($resql) {
|
||||
/*
|
||||
* Draft orders
|
||||
*/
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
@ -293,7 +293,7 @@ if ($resql) {
|
||||
* interventions to process
|
||||
*/
|
||||
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
|
||||
@ -93,7 +93,7 @@ if ($idprod > 0) {
|
||||
}
|
||||
|
||||
// After best supplier prices and before costprice
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
// Add price for pmp
|
||||
$price = $producttmp->pmp;
|
||||
if (empty($price) && !empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) {
|
||||
|
||||
@ -1097,7 +1097,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
|
||||
// If stock is incremented on validate order, we must increment it
|
||||
if (!$error && $movetoapprovestatus && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) {
|
||||
if (!$error && $movetoapprovestatus && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
@ -2085,7 +2085,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
|
||||
// If module stock is enabled and the stock increase is done on purchase order dispatching
|
||||
if (!$error && $entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
|
||||
if (!$error && $entrepot > 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
|
||||
$mouv = new MouvementStock($this->db);
|
||||
if ($product > 0) {
|
||||
// $price should take into account discount (except if option STOCK_EXCLUDE_DISCOUNT_FOR_PMP is on)
|
||||
|
||||
@ -762,7 +762,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
// else we get the best supplier price
|
||||
if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) {
|
||||
$buyprice = $producttmp->cost_price;
|
||||
} elseif (!empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) {
|
||||
} elseif (isModEnabled('stock') && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) {
|
||||
$buyprice = $producttmp->pmp;
|
||||
} else {
|
||||
if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) {
|
||||
@ -1812,7 +1812,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
// Si on incrémente le produit principal et ses composants à la validation de facture fournisseur
|
||||
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
|
||||
if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
@ -1943,7 +1943,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
}
|
||||
|
||||
// Si on incremente le produit principal et ses composants a la validation de facture fournisseur, on decremente
|
||||
if ($result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
|
||||
if ($result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ if (isModEnabled('project')) {
|
||||
}
|
||||
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
|
||||
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
if (isModEnabled('variants')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||
}
|
||||
|
||||
@ -485,7 +485,7 @@ if (empty($reshook)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') {
|
||||
if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') {
|
||||
if ($combinations = GETPOST('combinations', 'array')) {
|
||||
//Check if there is a product with the given combination
|
||||
$prodcomb = new ProductCombination($db);
|
||||
@ -990,7 +990,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) { // warning name of option should be STOCK_CALCULATE_ON_SUPPLIER_APPROVE_ORDER
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) { // warning name of option should be STOCK_CALCULATE_ON_SUPPLIER_APPROVE_ORDER
|
||||
if (!$idwarehouse || $idwarehouse == -1) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
@ -1926,7 +1926,7 @@ if ($action == 'create') {
|
||||
$action = '';
|
||||
} else {
|
||||
$text = $langs->trans('ConfirmValidateOrder', $newref);
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
@ -1947,7 +1947,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
$formquestion = array();
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) {
|
||||
$langs->load("stocks");
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -1963,7 +1963,7 @@ if ($action == 'create') {
|
||||
);
|
||||
}
|
||||
$text = $langs->trans("ConfirmApproveThisOrder", $object->ref);
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
@ -2561,7 +2561,7 @@ if ($action == 'create') {
|
||||
|
||||
// Ship
|
||||
$hasreception = 0;
|
||||
if (!empty($conf->stock->enabled) && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) {
|
||||
if (isModEnabled('stock') && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) {
|
||||
$labelofbutton = $langs->trans('ReceiveProducts');
|
||||
if ($conf->reception->enabled) {
|
||||
$labelofbutton = $langs->trans("CreateReception");
|
||||
|
||||
@ -96,7 +96,7 @@ if (empty($conf->reception->enabled)) {
|
||||
// $id is id of a purchase order.
|
||||
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
|
||||
|
||||
if (empty($conf->stock->enabled)) {
|
||||
if (!isModEnabled('stock')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -408,7 +408,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $permissiontoreceive
|
||||
$error++;
|
||||
} else {
|
||||
// If module stock is enabled and the stock increase is done on purchase order dispatching
|
||||
if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) && empty($supplierorderdispatch->fk_reception)) {
|
||||
if ($entrepot > 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) && empty($supplierorderdispatch->fk_reception)) {
|
||||
$mouv = new MouvementStock($db);
|
||||
if ($product > 0) {
|
||||
$mouv->origin = &$object;
|
||||
@ -455,7 +455,7 @@ if ($action == 'updateline' && $permissiontoreceive) {
|
||||
$errors = $supplierorderdispatch->errors;
|
||||
} else {
|
||||
// If module stock is enabled and the stock increase is done on purchase order dispatching
|
||||
if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
|
||||
if ($entrepot > 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
|
||||
$mouv = new MouvementStock($db);
|
||||
if ($product > 0) {
|
||||
$mouv->origin = &$object;
|
||||
|
||||
@ -55,7 +55,7 @@ if (isModEnabled('project')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
if (isModEnabled('variants')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||
}
|
||||
if (isModEnabled('accounting')) {
|
||||
@ -212,7 +212,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
|
||||
$langs->load("stocks");
|
||||
if (!$idwarehouse || $idwarehouse == -1) {
|
||||
$error++;
|
||||
@ -1465,7 +1465,7 @@ if (empty($reshook)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') {
|
||||
if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') {
|
||||
if ($combinations = GETPOST('combinations', 'array')) {
|
||||
//Check if there is a product with the given combination
|
||||
$prodcomb = new ProductCombination($db);
|
||||
@ -1743,7 +1743,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
|
||||
$langs->load("stocks");
|
||||
if (!$idwarehouse || $idwarehouse == -1) {
|
||||
$error++;
|
||||
@ -2704,7 +2704,7 @@ if ($action == 'create') {
|
||||
$action = '';
|
||||
} else {
|
||||
$text = $langs->trans('ConfirmValidateBill', $numref);
|
||||
/*if (!empty($conf->notification->enabled))
|
||||
/*if (isModEnabled('notification'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
||||
$notify=new Notify($db);
|
||||
@ -2720,7 +2720,7 @@ if ($action == 'create') {
|
||||
$qualified_for_stock_change = $object->hasProductsOrServices(1);
|
||||
}
|
||||
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
|
||||
$langs->load("stocks");
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -2752,7 +2752,7 @@ if ($action == 'create') {
|
||||
} else {
|
||||
$qualified_for_stock_change = $object->hasProductsOrServices(1);
|
||||
}
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
|
||||
$langs->load("stocks");
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
|
||||
@ -213,8 +213,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
if ((empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))
|
||||
|| (empty($conf->supplier_invoice->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) {
|
||||
if ((!isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))
|
||||
|| (!isModEnabled('supplier_invoice') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) {
|
||||
accessforbidden();
|
||||
}
|
||||
if ((empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))
|
||||
|
||||
@ -124,8 +124,8 @@ 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) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))
|
||||
|| (empty($conf->supplier_invoice->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) {
|
||||
if ((!isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))
|
||||
|| (!isModEnabled('supplier_invoice') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) {
|
||||
accessforbidden();
|
||||
}
|
||||
if ((empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))
|
||||
|
||||
@ -128,7 +128,7 @@ if ($object->id > 0) {
|
||||
$help_url = '';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = establishment_prepare_head($object);
|
||||
|
||||
@ -138,7 +138,7 @@ if ($object->id > 0) {
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = evaluationPrepareHead($object);
|
||||
|
||||
@ -353,7 +353,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
$text = $langs->trans('ConfirmValidateEvaluation', $numref);
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
|
||||
@ -138,7 +138,7 @@ if ($object->id > 0) {
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = jobPrepareHead($object);
|
||||
|
||||
@ -140,7 +140,7 @@ if ($object->id > 0) {
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = positionCardPrepareHead($object);
|
||||
|
||||
@ -139,7 +139,7 @@ if ($object->id > 0) {
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = skillPrepareHead($object);
|
||||
|
||||
@ -130,7 +130,7 @@ if ($object->id > 0) {
|
||||
$help_url = '';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = knowledgerecordPrepareHead($object);
|
||||
|
||||
@ -294,7 +294,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...)
|
||||
if ($action == 'close') {
|
||||
$text = $langs->trans('ConfirmCloseKM', $object->ref);
|
||||
/*if (!empty($conf->notification->enabled))
|
||||
/*if (isModEnabled('notification'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
@ -319,7 +319,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...)
|
||||
if ($action == 'reopen') {
|
||||
$text = $langs->trans('ConfirmReopenKM', $object->ref);
|
||||
/*if (!empty($conf->notification->enabled))
|
||||
/*if (isModEnabled('notification'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
|
||||
@ -190,7 +190,7 @@ if ($object->id > 0) {
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = myobjectPrepareHead($object);
|
||||
|
||||
@ -347,7 +347,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...)
|
||||
if ($action == 'xxx') {
|
||||
$text = $langs->trans('ConfirmActionMyObject', $object->ref);
|
||||
/*if (!empty($conf->notification->enabled))
|
||||
/*if (isModEnabled('notification'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
|
||||
@ -134,7 +134,7 @@ if ($object->id > 0) {
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = moPrepareHead($object);
|
||||
|
||||
@ -427,7 +427,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
$text = $langs->trans('ConfirmValidateMo', $numref);
|
||||
/*if (!empty($conf->notification->enabled))
|
||||
/*if (isModEnabled('notification'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
|
||||
@ -473,7 +473,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
$text = $langs->trans('ConfirmValidateMo', $numref);
|
||||
/*if (!empty($conf->notification->enabled))
|
||||
/*if (isModEnabled('notification'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
|
||||
@ -130,7 +130,7 @@ if ($object->id > 0) {
|
||||
$help_url = '';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = partnershipPrepareHead($object);
|
||||
|
||||
@ -370,7 +370,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
array('type' => 'text', 'name' => 'reason_decline_or_cancel', 'label' => $langs->trans("Note"), 'morecss' => 'reason_decline_or_cancel minwidth400', 'value' => '') // Field to complete private note (not replace)
|
||||
);
|
||||
|
||||
// if (!empty($conf->notification->enabled)) {
|
||||
// if (isModEnabled('notification')) {
|
||||
// require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
// $notify = new Notify($db);
|
||||
// $formquestion = array_merge($formquestion, array(
|
||||
|
||||
@ -545,7 +545,7 @@ print '<td>'.$langs->trans("VariantsAbility").'</td>';
|
||||
print '<td class="right">';
|
||||
//print ajax_constantonoff("PRODUIT_SOUSPRODUITS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
//print $form->selectyesno("PRODUIT_SOUSPRODUITS", $conf->global->PRODUIT_SOUSPRODUITS, 1);
|
||||
if (empty($conf->variants->enabled)) {
|
||||
if (!isModEnabled('variants')) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabled", $langs->transnoentitiesnoconv("Module610Name")).'</span>';
|
||||
} else {
|
||||
print yn(1).' <span class="opacitymedium">('.$langs->trans("ModuleIsEnabled", $langs->transnoentitiesnoconv("Module610Name")).')</span>';
|
||||
|
||||
@ -144,7 +144,7 @@ if ($id > 0 || $ref) {
|
||||
}
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$type = $langs->trans('Product');
|
||||
|
||||
@ -43,7 +43,7 @@ print dol_get_fiche_head('');
|
||||
<input type="hidden" name="action" value="add">
|
||||
<input type="hidden" name="type" value="0">
|
||||
<input type="hidden" name="canvas" value="<?php echo $canvas; ?>">
|
||||
<?php if (empty($conf->stock->enabled)) { ?>
|
||||
<?php if (!isModEnabled('stock')) { ?>
|
||||
<input name="seuil_stock_alerte" type="hidden" value="0">
|
||||
<?php } ?>
|
||||
|
||||
@ -72,7 +72,7 @@ print dol_get_fiche_head('');
|
||||
<td><?php echo $form->selectarray('statut_buy', $statutarray, $object->status_buy); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!empty($conf->stock->enabled)) { ?>
|
||||
<?php if (isModEnabled('stock')) { ?>
|
||||
<tr><td><?php echo $langs->trans("StockLimit"); ?></td><td>
|
||||
<input name="seuil_stock_alerte" size="4" value="<?php echo $object->seuil_stock_alerte; ?>">
|
||||
</td></tr>
|
||||
|
||||
@ -42,7 +42,7 @@ dol_htmloutput_errors($object->error, $object->errors);
|
||||
<input type="hidden" name="action" value="update">
|
||||
<input type="hidden" name="id" value="<?php echo $object->id; ?>">
|
||||
<input type="hidden" name="canvas" value="<?php echo $object->canvas; ?>">
|
||||
<?php if (empty($conf->stock->enabled)) { ?>
|
||||
<?php if (!isModEnabled('stock')) { ?>
|
||||
<input name="seuil_stock_alerte" type="hidden" value="0">
|
||||
<?php } ?>
|
||||
|
||||
@ -69,7 +69,7 @@ dol_htmloutput_errors($object->error, $object->errors);
|
||||
<td><?php echo $form->selectarray('statut_buy', $statutarray, $object->status_buy); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (!empty($conf->stock->enabled)) { ?>
|
||||
<?php if (isModEnabled('stock')) { ?>
|
||||
<tr><td><?php echo $langs->trans("StockLimit"); ?></td><td>
|
||||
<input name="seuil_stock_alerte" size="4" value="<?php echo $object->seuil_stock_alerte; ?>">
|
||||
</td></tr>
|
||||
|
||||
@ -71,13 +71,13 @@ if (isModEnabled('accounting')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
}
|
||||
if (!empty($conf->bom->enabled)) {
|
||||
if (isModEnabled('bom')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('products', 'other'));
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$langs->load("stocks");
|
||||
}
|
||||
if (isModEnabled('facture')) {
|
||||
@ -1457,7 +1457,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if ($type != 1 && !empty($conf->stock->enabled)) {
|
||||
if ($type != 1 && isModEnabled('stock')) {
|
||||
// Default warehouse
|
||||
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
|
||||
print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"');
|
||||
@ -2017,7 +2017,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Stock
|
||||
if ($object->isProduct() && !empty($conf->stock->enabled)) {
|
||||
if ($object->isProduct() && isModEnabled('stock')) {
|
||||
// Default warehouse
|
||||
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
|
||||
print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"');
|
||||
@ -2074,7 +2074,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$object->isService() && !empty($conf->bom->enabled)) {
|
||||
if (!$object->isService() && isModEnabled('bom')) {
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc", $langs->transnoentitiesnoconv("Finished"))).'</td><td>';
|
||||
$bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".((int) $object->id);
|
||||
print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1);
|
||||
@ -2515,7 +2515,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Default warehouse
|
||||
if ($object->isProduct() && !empty($conf->stock->enabled)) {
|
||||
if ($object->isProduct() && isModEnabled('stock')) {
|
||||
$warehouse = new Entrepot($db);
|
||||
$warehouse->fetch($object->fk_default_warehouse);
|
||||
|
||||
@ -2534,7 +2534,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Parent product.
|
||||
if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) {
|
||||
if (isModEnabled('variants') && ($object->isProduct() || $object->isService())) {
|
||||
$combination = new ProductCombination($db);
|
||||
|
||||
if ($combination->fetchByFkProductChild($object->id) > 0) {
|
||||
@ -2584,7 +2584,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$object->isService() && !empty($conf->bom->enabled) && $object->finished) {
|
||||
if (!$object->isService() && isModEnabled('bom') && $object->finished) {
|
||||
print '<tr><td class="titlefield">'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc", $langs->transnoentitiesnoconv("Finished"))).'</td><td>';
|
||||
if ($object->fk_default_bom) {
|
||||
$bom_static = new BOM($db);
|
||||
|
||||
@ -1279,7 +1279,7 @@ class Product extends CommonObject
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
if (isModEnabled('variants')) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||
|
||||
$comb = new ProductCombination($this->db);
|
||||
@ -4762,7 +4762,7 @@ class Product extends CommonObject
|
||||
public function isVariant()
|
||||
{
|
||||
global $conf;
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
if (isModEnabled('variants')) {
|
||||
$sql = "SELECT rowid FROM ".$this->db->prefix()."product_attribute_combination WHERE fk_product_child = ".((int) $this->id)." AND entity IN (".getEntity('product').")";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
@ -369,7 +369,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
// Min customer price
|
||||
print '<td class="right" colspan="2">'.$langs->trans('MinCustomerPrice').'</td>';
|
||||
// Stock
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="right">'.$langs->trans('Stock').'</td>';
|
||||
}
|
||||
// Qty in kit
|
||||
@ -444,7 +444,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '</td>';
|
||||
|
||||
// Stock
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="right">'.$value['stock'].'</td>'; // Real stock
|
||||
}
|
||||
|
||||
@ -493,7 +493,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '<td> </td>';
|
||||
|
||||
// Stock
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td></td>'; // Real stock
|
||||
}
|
||||
|
||||
@ -549,7 +549,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '</td>';
|
||||
|
||||
// Stock
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="liste_total right"> </td>';
|
||||
}
|
||||
|
||||
@ -566,7 +566,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '</tr>'."\n";
|
||||
} else {
|
||||
$colspan = 10;
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$colspan++;
|
||||
}
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ $optioncss = GETPOST('optioncss', 'alpha');
|
||||
$type = GETPOST("type", "int");
|
||||
|
||||
//Show/hide child products
|
||||
if (!empty($conf->variants->enabled) && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
||||
if (isModEnabled('variants') && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
||||
$show_childproducts = GETPOST('search_show_childproducts');
|
||||
} else {
|
||||
$show_childproducts = '';
|
||||
@ -234,10 +234,10 @@ $arrayfields = array(
|
||||
'p.numbuyprice'=>array('label'=>"BuyingPriceNumShort", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>43),
|
||||
'p.pmp'=>array('label'=>"PMPValueShort", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>44),
|
||||
'p.cost_price'=>array('label'=>"CostPrice", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>45),
|
||||
'p.seuil_stock_alerte'=>array('label'=>"StockLimit", 'checked'=>0, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>50),
|
||||
'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51),
|
||||
'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52),
|
||||
'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53),
|
||||
'p.seuil_stock_alerte'=>array('label'=>"StockLimit", 'checked'=>0, 'enabled'=>(isModEnabled('stock') && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>50),
|
||||
'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51),
|
||||
'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52),
|
||||
'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53),
|
||||
'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(isModEnabled('productbatch')), 'position'=>60),
|
||||
'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100),
|
||||
'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101),
|
||||
@ -419,7 +419,7 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||
$sql .= ' p.fk_unit, cu.label as cu_label,';
|
||||
}
|
||||
$sql .= ' MIN(pfp.unitprice) as minsellprice';
|
||||
if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
|
||||
if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
|
||||
$sql .= ', pac.rowid prod_comb_id';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
@ -448,7 +448,7 @@ if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$db->escape($langs->getDefaultLang())."'";
|
||||
}
|
||||
|
||||
if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
|
||||
if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
|
||||
}
|
||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||
@ -469,7 +469,7 @@ if (dol_strlen($search_type) && $search_type != '-1') {
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
|
||||
if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
|
||||
$sql .= " AND pac.rowid IS NULL";
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||
$sql .= ', p.fk_unit, cu.label';
|
||||
}
|
||||
|
||||
if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
|
||||
if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
|
||||
$sql .= ', pac.rowid';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
@ -837,7 +837,7 @@ if ($resql) {
|
||||
}
|
||||
|
||||
//Show/hide child products. Hidden by default
|
||||
if (!empty($conf->variants->enabled) && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
||||
if (isModEnabled('variants') && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<input type="checkbox" id="search_show_childproducts" name="search_show_childproducts"'.($show_childproducts ? 'checked="checked"' : '').'>';
|
||||
$moreforfilter .= ' <label for="search_show_childproducts">'.$langs->trans('ShowChildProducts').'</label>';
|
||||
@ -1360,7 +1360,7 @@ if ($resql) {
|
||||
}
|
||||
|
||||
// STOCK_DISABLE_OPTIM_LOAD can be set to force load_stock whatever is permissions on stock.
|
||||
if ((!empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || !empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) { // To optimize call of load_stock
|
||||
if ((isModEnabled('stock') && $user->rights->stock->lire && $search_type != 1) || !empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) { // To optimize call of load_stock
|
||||
if ($obj->fk_product_type != 1 || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Not a service
|
||||
$option = 'nobatch';
|
||||
if (empty($arrayfields['stock_virtual']['checked'])) {
|
||||
|
||||
@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ if (!empty($conf->project->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
if (isModEnabled('variants')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||
|
||||
@ -116,7 +116,7 @@ if ($object->id > 0) {
|
||||
$help_url = '';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) $langs->load("mails");
|
||||
if (isModEnabled('notification')) $langs->load("mails");
|
||||
$head = stocktransferPrepareHead($object);
|
||||
|
||||
|
||||
|
||||
@ -1276,7 +1276,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
if (empty($reshook)) {
|
||||
if ($action != "edit" && $action != 'presend') {
|
||||
// Create event
|
||||
/*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a
|
||||
/*if (isModEnabled('agenda') && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a
|
||||
// "workflow" action so should appears somewhere else on
|
||||
// page.
|
||||
{
|
||||
@ -1292,7 +1292,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
|
||||
// Accounting Report
|
||||
/*
|
||||
$accouting_module_activated = !empty($conf->comptabilite->enabled) || isModEnabled('accounting');
|
||||
$accouting_module_activated = isModEnabled('comptabilite') || isModEnabled('accounting');
|
||||
if ($accouting_module_activated && $object->statut != Project::STATUS_DRAFT) {
|
||||
$start = dol_getdate((int) $object->date_start);
|
||||
$end = dol_getdate((int) $object->date_end);
|
||||
@ -1369,7 +1369,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
$langs->load("suppliers");
|
||||
print dolGetButtonAction('', $langs->trans('AddSupplierInvoice'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) {
|
||||
if (isModEnabled('ficheinter') && $user->rights->ficheinter->creer) {
|
||||
$langs->load("interventions");
|
||||
print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
@ -1381,7 +1381,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
$langs->load("trips");
|
||||
print dolGetButtonAction('', $langs->trans('AddTrip'), 'default', DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
if (!empty($conf->don->enabled) && $user->rights->don->creer) {
|
||||
if (isModEnabled('don') && $user->rights->don->creer) {
|
||||
$langs->load("donations");
|
||||
print dolGetButtonAction('', $langs->trans('AddDonation'), 'default', DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||
}
|
||||
if (isModEnabled("propal")) {
|
||||
@ -62,7 +62,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
|
||||
if (isModEnabled('contrat')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
}
|
||||
if (isModEnabled("expedition")) {
|
||||
@ -77,14 +77,14 @@ if (isModEnabled('expensereport')) {
|
||||
if (isModEnabled('agenda')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
}
|
||||
if (!empty($conf->don->enabled)) {
|
||||
if (isModEnabled('don')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
}
|
||||
if (!empty($conf->loan->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/loan/class/loanschedule.class.php';
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
}
|
||||
if (isModEnabled('tax')) {
|
||||
@ -114,7 +114,7 @@ if (isModEnabled('commande')) {
|
||||
if (isModEnabled("propal")) {
|
||||
$langs->load("propal");
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
if (isModEnabled('ficheinter')) {
|
||||
$langs->load("interventions");
|
||||
}
|
||||
if (isModEnabled('deplacement')) {
|
||||
@ -123,7 +123,7 @@ if (isModEnabled('deplacement')) {
|
||||
if (isModEnabled('expensereport')) {
|
||||
$langs->load("trips");
|
||||
}
|
||||
if (!empty($conf->don->enabled)) {
|
||||
if (isModEnabled('don')) {
|
||||
$langs->load("donations");
|
||||
}
|
||||
if (!empty($conf->loan->enabled)) {
|
||||
@ -716,7 +716,7 @@ if (!$showdatefilter) {
|
||||
|
||||
$langs->loadLangs(array("suppliers", "bills", "orders", "proposals", "margins"));
|
||||
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$langs->load('stocks');
|
||||
}
|
||||
|
||||
|
||||
@ -1060,7 +1060,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
}
|
||||
if ( !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) {
|
||||
if ( isModEnabled('ficheinter') && $user->rights->ficheinter->creer) {
|
||||
$langs->load("interventions");
|
||||
$arrayofmassactions['generateinter'] = $langs->trans("GenerateInter");
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
|
||||
// Security check
|
||||
if (empty($conf->don->enabled)) {
|
||||
if (!isModEnabled('don')) {
|
||||
httponly_accessforbidden('Module Donation not enabled');
|
||||
}
|
||||
|
||||
|
||||
@ -91,7 +91,7 @@ if (!empty($conf->global->TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST))
|
||||
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
if (empty($conf->ticket->enabled)) {
|
||||
if (!isModEnabled('ticket')) {
|
||||
httponly_accessforbidden('Module Ticket not enabled');
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ $track_id = GETPOST('track_id', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$suffix = "";
|
||||
|
||||
if (empty($conf->ticket->enabled)) {
|
||||
if (!isModEnabled('ticket')) {
|
||||
httponly_accessforbidden('Module Ticket not enabled');
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ $object = new Ticket($db);
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('ticketpubliclist', 'globalcard'));
|
||||
|
||||
if (empty($conf->ticket->enabled)) {
|
||||
if (!isModEnabled('ticket')) {
|
||||
httponly_accessforbidden('Module Ticket not enabled');
|
||||
}
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ if (isset($_SESSION['email_customer'])) {
|
||||
|
||||
$object = new ActionsTicket($db);
|
||||
|
||||
if (empty($conf->ticket->enabled)) {
|
||||
if (!isModEnabled('ticket')) {
|
||||
httponly_accessforbidden('Module Ticket not enabled');
|
||||
}
|
||||
|
||||
|
||||
@ -752,7 +752,7 @@ if ($action == 'create') {
|
||||
$author = new User($db);
|
||||
$author->fetch($objectsrc->user_author_id);
|
||||
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
$entrepot = new Entrepot($db);
|
||||
}
|
||||
|
||||
@ -1039,7 +1039,7 @@ if ($action == 'create') {
|
||||
print ' / <a href="#" id="autoreset">'.$langs->trans("Reset").'</a>)';
|
||||
}
|
||||
print '</td>';
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>';
|
||||
}
|
||||
if (isModEnabled('productbatch')) {
|
||||
@ -1173,7 +1173,7 @@ if ($action == 'create') {
|
||||
|
||||
|
||||
$warehouseObject = null;
|
||||
if (!empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
|
||||
if (isModEnabled('stock')) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
|
||||
print '<!-- Case warehouse already known or product not a predefined product -->';
|
||||
|
||||
$stock = + $product->stock_warehouse[$dispatchLines[$indiceAsked]['ent']]->real; // Convert to number
|
||||
@ -1200,7 +1200,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Stock
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="left">';
|
||||
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Type of product need stock change ?
|
||||
// Show warehouse combo list
|
||||
@ -1323,7 +1323,7 @@ if ($action == 'create') {
|
||||
|
||||
$text = $langs->trans("ConfirmValidateReception", $numref);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
@ -1686,7 +1686,7 @@ if ($action == 'create') {
|
||||
}
|
||||
if ($action == 'editline') {
|
||||
$editColspan = 3;
|
||||
if (empty($conf->stock->enabled)) {
|
||||
if (!isModEnabled('stock')) {
|
||||
$editColspan--;
|
||||
}
|
||||
if (empty($conf->productbatch->enabled)) {
|
||||
@ -1698,7 +1698,7 @@ if ($action == 'create') {
|
||||
} else {
|
||||
print $langs->trans("QtyReceived").' - ';
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print $langs->trans("WarehouseSource").' - ';
|
||||
}
|
||||
if (isModEnabled('productbatch')) {
|
||||
@ -1718,7 +1718,7 @@ if ($action == 'create') {
|
||||
} else {
|
||||
print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="left">'.$langs->trans("WarehouseSource").'</td>';
|
||||
}
|
||||
|
||||
@ -1889,7 +1889,7 @@ if ($action == 'create') {
|
||||
print ' - '.$receptionline_var['qty'];
|
||||
|
||||
$htmltext = $langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($receptionline_var['date_valid'], 'dayhour'));
|
||||
if (!empty($conf->stock->enabled) && $receptionline_var['warehouse'] > 0) {
|
||||
if (isModEnabled('stock') && $receptionline_var['warehouse'] > 0) {
|
||||
$warehousestatic->fetch($receptionline_var['warehouse']);
|
||||
$htmltext .= '<br>'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1, '', 0, 1);
|
||||
}
|
||||
@ -1904,7 +1904,7 @@ if ($action == 'create') {
|
||||
if ($action == 'editline' && $lines[$i]->id == $line_id) {
|
||||
// edit mode
|
||||
print '<td colspan="'.$editColspan.'" class="center"><table class="nobordernopadding">';
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
if ($lines[$i]->fk_product > 0) {
|
||||
print '<!-- case edit 1 -->';
|
||||
print '<tr>';
|
||||
@ -1944,7 +1944,7 @@ if ($action == 'create') {
|
||||
print '<td class="center linecolqtytoreceive">'.$lines[$i]->qty.'</td>';
|
||||
|
||||
// Warehouse source
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
if (isModEnabled('stock')) {
|
||||
if ($lines[$i]->fk_entrepot > 0) {
|
||||
$entrepot = new Entrepot($db);
|
||||
$entrepot->fetch($lines[$i]->fk_entrepot);
|
||||
|
||||
@ -546,7 +546,7 @@ class Reception extends CommonObject
|
||||
}
|
||||
|
||||
// If stock increment is done on reception (recommanded choice)
|
||||
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)) {
|
||||
if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
|
||||
$langs->load("agenda");
|
||||
@ -824,7 +824,7 @@ class Reception extends CommonObject
|
||||
}
|
||||
|
||||
$fk_product = 0;
|
||||
if (!empty($conf->stock->enabled) && !empty($supplierorderline->fk_product)) {
|
||||
if (isModEnabled('stock') && !empty($supplierorderline->fk_product)) {
|
||||
$fk_product = $supplierorderline->fk_product;
|
||||
|
||||
if (!($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_RECEPTIONS)) {
|
||||
@ -1554,7 +1554,7 @@ class Reception extends CommonObject
|
||||
|
||||
|
||||
// If stock increment is done on closing
|
||||
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
|
||||
if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
|
||||
$langs->load("agenda");
|
||||
@ -1719,7 +1719,7 @@ class Reception extends CommonObject
|
||||
$this->billed = 0;
|
||||
|
||||
// If stock increment is done on closing
|
||||
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
|
||||
if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$numref = $this->ref;
|
||||
$langs->load("agenda");
|
||||
@ -1851,7 +1851,7 @@ class Reception extends CommonObject
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
// If stock increment is done on closing
|
||||
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)) {
|
||||
if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
|
||||
$langs->load("agenda");
|
||||
|
||||
@ -716,7 +716,7 @@ if ($massaction == 'createbills') {
|
||||
print $langs->trans('ValidateInvoices');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
|
||||
print $form->selectyesno('validate_invoices', 0, 1, 1);
|
||||
print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')';
|
||||
} else {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user