@@ -1137,7 +1137,7 @@ if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) {
}
}
- if (empty($paiementsModes) && !empty($conf->banque->enabled)) {
+ if (empty($paiementsModes) && isModEnabled('banque')) {
$langs->load('errors');
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index bdc11c79b2f..0ba87cce069 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -171,7 +171,7 @@ if ($invoice->socid > 0) {
}
// Change the currency of invoice if it was modified
-if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"])) {
+if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"])) {
if ($invoice->multicurrency_code != $_SESSION["takeposcustomercurrency"]) {
$invoice->setMulticurrencyCode($_SESSION["takeposcustomercurrency"]);
}
@@ -205,7 +205,7 @@ if (empty($reshook)) {
}
}
- if ($bankaccount <= 0 && $pay != "delayed" && !empty($conf->banque->enabled)) {
+ if ($bankaccount <= 0 && $pay != "delayed" && isModEnabled('banque')) {
$errormsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount"));
$error++;
}
@@ -261,14 +261,14 @@ if (empty($reshook)) {
$error++;
dol_syslog('Sale without lines');
dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1);
- } elseif (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") {
+ } elseif (isModEnabled('stock') && $conf->global->$constantforkey != "1") {
$savconst = $conf->global->STOCK_CALCULATE_ON_BILL;
$conf->global->STOCK_CALCULATE_ON_BILL = 1;
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".$conf->global->$constantforkey);
$batch_rule = 0;
- if (!empty($conf->productbatch->enabled) && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
+ if (isModEnabled('productbatch') && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
$batch_rule = Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST;
}
@@ -457,13 +457,13 @@ if (empty($reshook)) {
$creditnote->update_price(1);
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];
- if (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") {
+ if (isModEnabled('stock') && $conf->global->$constantforkey != "1") {
$savconst = $conf->global->STOCK_CALCULATE_ON_BILL;
$conf->global->STOCK_CALCULATE_ON_BILL = 1;
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".$conf->global->$constantforkey);
$batch_rule = 0;
- if (!empty($conf->productbatch->enabled) && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
+ if (isModEnabled('productbatch') && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
$batch_rule = Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST;
}
@@ -1163,7 +1163,7 @@ $( document ).ready(function() {
$idwarehouse = 0;
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
- if (!empty($conf->stock->enabled)) {
+ if (isModEnabled('stock')) {
if (getDolGlobalString("$constantforkey") != "1") {
$constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
$idwarehouse = getDolGlobalString($constantforkey);
@@ -1199,7 +1199,7 @@ $( document ).ready(function() {
// Module Adherent
$s = '';
- if (!empty($conf->adherent->enabled) && $invoice->socid > 0 && $invoice->socid != $conf->global->$constforcompanyid) {
+ if (isModEnabled('adherent') && $invoice->socid > 0 && $invoice->socid != $conf->global->$constforcompanyid) {
$s = '';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$langs->load("members");
@@ -1320,7 +1320,7 @@ if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) {
// In phone version only show when it is invoice page
if (empty($mobilepage) || $mobilepage == "invoice") {
print '' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '';
- if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
+ if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db);
@@ -1336,7 +1336,7 @@ if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) {
// In phone version only show when it is invoice page
if (empty($mobilepage) || $mobilepage == "invoice") {
print ''.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).'';
- if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
+ if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db);
@@ -1568,7 +1568,7 @@ if ($placeid > 0) {
$htmlforlines .= '
'.vatrate($line->remise_percent, true).'
';
$htmlforlines .= '
';
- if (!empty($conf->stock->enabled) && !empty($user->rights->stock->mouvement->lire)) {
+ if (isModEnabled('stock') && !empty($user->rights->stock->mouvement->lire)) {
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
if (!empty($conf->global->$constantforkey) && $line->fk_product > 0 && empty($conf->global->TAKEPOS_HIDE_STOCK_ON_LINE)) {
$sql = "SELECT e.rowid, e.ref, e.lieu, e.fk_parent, e.statut, ps.reel, ps.rowid as product_stock_id, p.pmp";
@@ -1605,7 +1605,7 @@ if ($placeid > 0) {
if (getDolGlobalString('TAKEPOS_SHOW_HT')) {
$htmlforlines .= '
';
$htmlforlines .= price($line->total_ht, 1, '', 1, -1, -1, $conf->currency);
- if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
+ if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db);
@@ -1616,7 +1616,7 @@ if ($placeid > 0) {
}
$htmlforlines .= '
';
$htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency);
- if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
+ if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db);
diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php
index 40d873654c6..ca6a3d2f630 100644
--- a/htdocs/takepos/pay.php
+++ b/htdocs/takepos/pay.php
@@ -111,7 +111,7 @@ if ($resql) {
$arrayOfValidBankAccount[$conf->global->$accountname] = $conf->global->$accountname;
$arrayOfValidPaymentModes[] = $obj;
}
- if (empty($conf->banque->enabled)) {
+ if (!isModEnabled('banque')) {
if ($paycode == 'CASH' || $paycode == 'CB') $arrayOfValidPaymentModes[] = $obj;
}
}
diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php
index 41c15ca610b..fafee970bae 100644
--- a/htdocs/takepos/receipt.php
+++ b/htdocs/takepos/receipt.php
@@ -258,7 +258,7 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER) {
} ?>
multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
+if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db);
@@ -288,7 +288,7 @@ if ($conf->global->TAKEPOS_PRINT_PAYMENT_METHOD) {
echo $langs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
echo '';
echo '
';
- $amount_payment = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
+ $amount_payment = (isModEnabled('multicurrency') && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
if ($row->code == "LIQ") {
$amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment
}