diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 7f2bf439c09..48d7d86e89f 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -85,7 +85,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { // Clean code // To manage zero or not at the end of the accounting account - if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + if (getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) { $account_number = $account_number; } else { $account_number = clean_account($account_number); @@ -148,7 +148,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { // Clean code // To manage zero or not at the end of the accounting account - if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + if (getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) { $account_number = $account_number; } else { $account_number = clean_account($account_number); diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 18a85ca923c..b6923b36022 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -330,7 +330,7 @@ if (!empty($searchCategoryProductList)) { } $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; if (strlen(trim($search_current_account))) { - $sql .= natural_search((empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p." : "ppe.") . $accountancy_field_name, $search_current_account); + $sql .= natural_search((!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p." : "ppe.") . $accountancy_field_name, $search_current_account); } if ($search_current_account_valid == 'withoutvalidaccount') { $sql .= " AND aa.account_number IS NULL"; @@ -614,7 +614,7 @@ if ($resql) { } else { print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center '); } - print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p." : "ppe.") . $accountancy_field_name, "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p." : "ppe.") . $accountancy_field_name, "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AssignDedicatedAccountingAccount"); // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 18b67413fa7..994cb9b1466 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -376,7 +376,7 @@ if ($action != 'export_csv') { } $moreforfilter .= ''; - if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { + if (getDolGlobalString('ACCOUNTING_ENABLE_LETTERING')) { $moreforfilter .= '
| '.$langs->trans("SubTotal").': | '; - if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { + if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { print ''.price($sous_total_opening_balance).' | '; } print ''.price($sous_total_debit).' | '; print ''.price($sous_total_credit).' | '; - if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { + if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { print ''.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).' | '; } else { print ''.price(price2num($sous_total_debit - $sous_total_credit)).' | '; @@ -571,7 +571,7 @@ if ($action != 'export_csv') { // print ''; //} - if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { + if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { print ' | '.price(price2num($opening_balance, 'MT')).' | '; } @@ -602,7 +602,7 @@ if ($action != 'export_csv') { // Credit print ''.price(price2num($line->credit, 'MT')).' | '; - if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { + if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { print ''.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).' | '; } else { print ''.price(price2num($line->debit - $line->credit, 'MT')).' | '; @@ -630,12 +630,12 @@ if ($action != 'export_csv') { print "\n"; } print ' | '.$langs->trans("SubTotal").': | '; - if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { + if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { print ''.price(price2num($sous_total_opening_balance, 'MT')).' | '; } print ''.price(price2num($sous_total_debit, 'MT')).' | '; print ''.price(price2num($sous_total_credit, 'MT')).' | '; - if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { + if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { print '' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . ' | '; } else { print '' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . ' | '; @@ -653,12 +653,12 @@ if ($action != 'export_csv') { print "\n"; } print ' | '.$langs->trans("AccountBalance").': | '; - if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { + if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { print ''.price(price2num($total_opening_balance, 'MT')).' | '; } print ''.price(price2num($total_debit, 'MT')).' | '; print ''.price(price2num($total_credit, 'MT')).' | '; - if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { + if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { print '' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . ' | '; } else { print '' . price(price2num($total_debit - $total_credit, 'MT')) . ' | '; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 00afaf9795d..657ab76baf5 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -683,7 +683,7 @@ if ($action == 'create') { // It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases. // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. - if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { + if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); } else { print 'subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; @@ -709,7 +709,7 @@ if ($action == 'create') { // It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases. // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. - if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { + if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); } else { print ''; diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 7f95698caa5..3d8de4d7a45 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -134,7 +134,7 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha'); $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); @@ -206,7 +206,7 @@ $arrayfields = array( 't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100), ); -if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { +if (!getDolGlobalString('ACCOUNTING_ENABLE_LETTERING')) { unset($arrayfields['t.lettering_code']); } @@ -464,7 +464,7 @@ if (empty($reshook)) { } if (!$error) { - if (empty($conf->global->ACCOUNTING_REEXPORT)) { + if (!getDolGlobalString('ACCOUNTING_REEXPORT')) { setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'mesgs'); } else { setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsEnable"), null, 'warnings'); @@ -562,7 +562,7 @@ if (count($filter) > 0) { } } $sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')'; -if (empty($conf->global->ACCOUNTING_REEXPORT)) { // Reexport not enabled (default mode) +if (!getDolGlobalString('ACCOUNTING_REEXPORT')) { // Reexport not enabled (default mode) $sql .= " AND t.date_export IS NULL"; } if (count($sqlwhere) > 0) { @@ -576,7 +576,7 @@ if (count($sqlwhere) > 0) { if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements', 'export')) { // TODO Replace the fetchAll to get all ->line followed by call to ->export(). fetchAll() currently consumes too much memory on large export. // Replace this with the query($sql) and loop on each line to export them. - $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); + $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (!getDolGlobalString('ACCOUNTING_REEXPORT') ? 0 : 1)); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -728,7 +728,7 @@ if ($action == 'export_file') { if (getDolGlobalInt("ACCOUNTING_ENABLE_LETTERING")) { // If 1, we check by default. - $checked = !empty($conf->global->ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING) ? 'true' : 'false'; + $checked = getDolGlobalString('ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING') ? 'true' : 'false'; $form_question['notexportlettering'] = array( 'name' => 'notexportlettering', 'type' => 'checkbox', @@ -740,19 +740,19 @@ if ($action == 'export_file') { } // If 1 or not set, we check by default. - $checked = (!isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE)); + $checked = (!isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) || getDolGlobalString('ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE')); $form_question['notifiedexportdate'] = array( 'name' => 'notifiedexportdate', 'type' => 'checkbox', 'label' => $langs->trans('NotifiedExportDate'), - 'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'), + 'value' => (getDolGlobalString('ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE') ? 'false' : 'true'), ); $form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator'); if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { // If 0 or not set, we NOT check by default. - $checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE)); + $checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || getDolGlobalString('ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE')); $form_question['notifiedvalidationdate'] = array( 'name' => 'notifiedvalidationdate', 'type' => 'checkbox', @@ -817,7 +817,7 @@ if ($reshook < 0) { $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; if (empty($reshook)) { // Button re-export - if (empty($conf->global->ACCOUNTING_REEXPORT)) { + if (!getDolGlobalString('ACCOUNTING_REEXPORT')) { $newcardbutton .= ''.img_picto($langs->trans("ClickToShowAlreadyExportedLines"), 'switch_off', 'class="small size15x valignmiddle"'); $newcardbutton .= ''.$langs->trans("ClickToShowAlreadyExportedLines").''; $newcardbutton .= ''; @@ -835,7 +835,7 @@ if (empty($reshook)) { print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); // Not display message when all the list of docs are included -if (empty($conf->global->ACCOUNTING_REEXPORT)) { +if (!getDolGlobalString('ACCOUNTING_REEXPORT')) { print info_admin($langs->trans("WarningDataDisappearsWhenDataIsExported"), 0, 0, 0, 'hideonsmartphone info'); } @@ -924,7 +924,7 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) { print '';
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
- if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
+ if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) {
print ' ';
//print $langs->trans('From').' ';
print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', $langs->trans('From'), 'maxwidth250', 'subledgeraccount');
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 74c111e8cf1..41498ff586d 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -129,7 +129,7 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha');
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$optioncss = GETPOST('optioncss', 'alpha');
@@ -201,7 +201,7 @@ $arrayfields = array(
't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100),
);
-if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
+if (!getDolGlobalString('ACCOUNTING_ENABLE_LETTERING')) {
unset($arrayfields['t.lettering_code']);
}
@@ -871,7 +871,7 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) {
print ' ';
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
- if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
+ if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) {
print ' | ';
//print $langs->trans('From').' ';
print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', $langs->trans('From'), 'maxwidth250', 'subledgeraccount');
diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index c55e9db7788..7135044ef09 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -104,7 +104,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_
}
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$optioncss = GETPOST('optioncss', 'alpha');
@@ -172,7 +172,7 @@ $arrayfields = array(
't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100),
);
-if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
+if (!getDolGlobalString('ACCOUNTING_ENABLE_LETTERING')) {
unset($arrayfields['t.lettering_code']);
}
diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php
index aa94e8c12a6..7cd826336d5 100644
--- a/htdocs/accountancy/class/accountancyexport.class.php
+++ b/htdocs/accountancy/class/accountancyexport.class.php
@@ -103,7 +103,7 @@ class AccountancyExport
$this->db = $db;
$this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
- $this->end_line = empty($conf->global->ACCOUNTING_EXPORT_ENDLINE) ? "\n" : (getDolGlobalInt('ACCOUNTING_EXPORT_ENDLINE') == 1 ? "\n" : "\r\n");
+ $this->end_line = !getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE') ? "\n" : (getDolGlobalInt('ACCOUNTING_EXPORT_ENDLINE') == 1 ? "\n" : "\r\n");
$hookmanager->initHooks(array('accountancyexport'));
}
@@ -201,9 +201,9 @@ class AccountancyExport
'param' => array(
self::$EXPORT_TYPE_CONFIGURABLE => array(
'label' => $langs->trans('Modelcsv_configurable'),
- 'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT) ? 'txt' : $conf->global->ACCOUNTING_EXPORT_FORMAT,
- 'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV) ? ',' : $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
- 'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE) ? 1 : $conf->global->ACCOUNTING_EXPORT_ENDLINE,
+ 'ACCOUNTING_EXPORT_FORMAT' => !getDolGlobalString('ACCOUNTING_EXPORT_FORMAT') ? 'txt' : $conf->global->ACCOUNTING_EXPORT_FORMAT,
+ 'ACCOUNTING_EXPORT_SEPARATORCSV' => !getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV') ? ',' : $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
+ 'ACCOUNTING_EXPORT_ENDLINE' => !getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE') ? 1 : $conf->global->ACCOUNTING_EXPORT_ENDLINE,
'ACCOUNTING_EXPORT_DATE' => getDolGlobalString('ACCOUNTING_EXPORT_DATE', '%Y-%m-%d'),
),
self::$EXPORT_TYPE_CEGID => array(
diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php
index b8091164925..bce01982e03 100644
--- a/htdocs/accountancy/class/accountingaccount.class.php
+++ b/htdocs/accountancy/class/accountingaccount.class.php
@@ -537,7 +537,7 @@ class AccountingAccount extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
- if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+ if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $labelurl;
$linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"';
}
@@ -864,7 +864,7 @@ class AccountingAccount extends CommonObject
}
// Level 3 (define $code_t): Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
- if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
+ if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) {
if (!empty($buyer->code_compta_product)) {
$code_t = $buyer->code_compta_product;
$suggestedid = $accountingAccount['thirdparty'];
@@ -914,7 +914,7 @@ class AccountingAccount extends CommonObject
}
// If $suggestedid could not be guessed yet, we set it from the generic default accounting code $code_l
- if (empty($suggestedid) && empty($code_p) && !empty($code_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) {
+ if (empty($suggestedid) && empty($code_p) && !empty($code_l) && !getDolGlobalString('ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC')) {
if (empty($this->accountingaccount_codetotid_cache[$code_l])) {
$tmpaccount = new self($this->db);
$result = $tmpaccount->fetch(0, $code_l, 1);
diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php
index ccf5d67dcfd..321891c2f53 100644
--- a/htdocs/accountancy/class/accountingjournal.class.php
+++ b/htdocs/accountancy/class/accountingjournal.class.php
@@ -262,7 +262,7 @@ class AccountingJournal extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
- if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+ if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAccountingJournal");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@@ -465,7 +465,7 @@ class AccountingJournal extends CommonObject
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($date_start) . "' AND ad.depreciation_date <= '" . $this->db->idate($date_end) . "'";
}
// Define begin binding date
- if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
+ if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($conf->global->ACCOUNTING_DATE_START_BINDING) . "'";
}
$sql .= " ORDER BY ad.depreciation_date";
@@ -614,7 +614,7 @@ class AccountingJournal extends CommonObject
$disposal_date = $pre_data_info['disposal']['date'];
if ((!($date_start && $date_end) || ($date_start <= $disposal_date && $disposal_date <= $date_end)) &&
- (empty($conf->global->ACCOUNTING_DATE_START_BINDING) || $conf->global->ACCOUNTING_DATE_START_BINDING <= $disposal_date)
+ (!getDolGlobalString('ACCOUNTING_DATE_START_BINDING') || $conf->global->ACCOUNTING_DATE_START_BINDING <= $disposal_date)
) {
$disposal_amount = $pre_data_info['disposal']['amount'];
$disposal_subject_to_vat = $pre_data_info['disposal']['subject_to_vat'];
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 634e4f54f83..288e34b5dcb 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -315,7 +315,7 @@ class BookKeeping extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'";
$sql .= " AND fk_doc = ".((int) $this->fk_doc);
- if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
+ if (getDolGlobalString('ACCOUNTANCY_ENABLE_FKDOCDET')) {
// DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
$sql .= " AND fk_docdet = ".((int) $this->fk_docdet); // This field can be 0 if record is for several lines
}
@@ -333,7 +333,7 @@ class BookKeeping extends CommonObject
$sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sqlnum .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'"; // For example doc_type = 'bank'
$sqlnum .= " AND fk_doc = ".((int) $this->fk_doc);
- if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
+ if (getDolGlobalString('ACCOUNTANCY_ENABLE_FKDOCDET')) {
// fk_docdet is rowid into llx_bank or llx_facturedet or llx_facturefourndet, or ...
$sqlnum .= " AND fk_docdet = ".((int) $this->fk_docdet);
}
@@ -508,7 +508,7 @@ class BookKeeping extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
- if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+ if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowTransaction");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php
index e867070ed2d..4d29a60f1d9 100644
--- a/htdocs/accountancy/customer/card.php
+++ b/htdocs/accountancy/customer/card.php
@@ -101,7 +101,7 @@ $formaccounting = new FormAccounting($db);
if (!empty($id)) {
$sql = "SELECT f.ref, f.rowid as facid, l.fk_product, l.description, l.price,";
$sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,";
- if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= " ppe.accountancy_code_sell as code_sell,";
} else {
$sql .= " p.accountancy_code_sell as code_sell,";
@@ -109,7 +109,7 @@ if (!empty($id)) {
$sql .= " l.fk_code_ventilation, aa.account_number, aa.label";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
- if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index 01c0425136c..73f7671b3d0 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -131,7 +131,7 @@ if ($action == 'validatehistory') {
$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype, f.situation_cycle_ref, f.fk_facture_source,";
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.situation_percent, l.tva_tx as tva_tx_line, l.vat_src_code,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tva_tx as tva_tx_prod,";
- if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= " ppe.accountancy_code_sell as code_sell, ppe.accountancy_code_sell_intra as code_sell_intra, ppe.accountancy_code_sell_export as code_sell_export,";
} else {
$sql .= " p.accountancy_code_sell as code_sell, p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
@@ -139,24 +139,24 @@ if ($action == 'validatehistory') {
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export, aa4.rowid as aarowid_thirdparty,";
$sql .= " co.code as country_code, co.label as country_label,";
$sql .= " s.tva_intra,";
- if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql .= " spe.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty
} else {
$sql .= " s.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty
}
$sql .= " FROM ".$db->prefix()."facture as f";
$sql .= " INNER JOIN ".$db->prefix()."societe as s ON s.rowid = f.fk_soc";
- if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql .= " LEFT JOIN " . $db->prefix() . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
}
$sql .= " LEFT JOIN ".$db->prefix()."c_country as co ON co.rowid = s.fk_pays ";
$sql .= " INNER JOIN ".$db->prefix()."facturedet as l ON f.rowid = l.fk_facture"; // the main table
$sql .= " LEFT JOIN ".$db->prefix()."product as p ON p.rowid = l.fk_product";
- if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
+ if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= " LEFT JOIN " . $db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
}
- $alias_societe_perentity = empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED) ? "s" : "spe";
- $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p" : "ppe";
+ $alias_societe_perentity = !getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED') ? "s" : "spe";
+ $alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe";
$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
$sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
@@ -164,7 +164,7 @@ if ($action == 'validatehistory') {
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND l.product_type <= 2";
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
- if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
+ if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
if ($validatemonth && $validateyear) {
@@ -370,14 +370,14 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd
$sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
// Define begin binding date
-if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
+if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
$sql .= " AND f.fk_statut > 0";
$sql .= " AND fd.product_type <= 2";
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
$sql .= " AND aa.account_number IS NULL";
-if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
+if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
} else {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
@@ -507,13 +507,13 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd
$sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
// Define begin binding date
-if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
+if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
$sql .= " AND f.fk_statut > 0";
$sql .= " AND fd.product_type <= 2";
-if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
+if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.", ".Facture::TYPE_REPLACEMENT.", ".Facture::TYPE_CREDIT_NOTE.", ".Facture::TYPE_SITUATION.")";
} else {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.", ".Facture::TYPE_REPLACEMENT.", ".Facture::TYPE_CREDIT_NOTE.", ".Facture::TYPE_DEPOSIT.", ".Facture::TYPE_SITUATION.")";
@@ -612,13 +612,13 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
$sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
// Define begin binding date
- if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
+ if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
$sql .= " AND f.fk_statut > 0";
$sql .= " AND fd.product_type <= 2";
- if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
+ if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.", ".Facture::TYPE_REPLACEMENT.", ".Facture::TYPE_CREDIT_NOTE.", ".Facture::TYPE_SITUATION.")";
} else {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.", ".Facture::TYPE_REPLACEMENT.", ".Facture::TYPE_CREDIT_NOTE.", ".Facture::TYPE_DEPOSIT.", ".Facture::TYPE_SITUATION.")";
@@ -697,13 +697,13 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
$sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
// Define begin binding date
- if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
+ if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
$sql .= " AND f.fk_statut > 0";
$sql .= " AND fd.product_type <= 2";
- if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
+ if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.", ".Facture::TYPE_REPLACEMENT.", ".Facture::TYPE_CREDIT_NOTE.", ".Facture::TYPE_SITUATION.")";
} else {
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.", ".Facture::TYPE_REPLACEMENT.", ".Facture::TYPE_CREDIT_NOTE.", ".Facture::TYPE_DEPOSIT.", ".Facture::TYPE_SITUATION.")";
diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php
index 2079e28c15f..cf1d558e3a5 100644
--- a/htdocs/accountancy/customer/lines.php
+++ b/htdocs/accountancy/customer/lines.php
@@ -65,7 +65,7 @@ $search_country = GETPOST('search_country', 'alpha');
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -200,7 +200,7 @@ print ' |