update code

This commit is contained in:
Philippe GRAND
2022-09-04 13:29:29 +02:00
parent a8531a4afd
commit 2cd48587ed
5 changed files with 11 additions and 11 deletions

View File

@@ -513,7 +513,7 @@ $tabcond[27] = isModEnabled("societe");
$tabcond[28] = isModEnabled('holiday');
$tabcond[29] = isModEnabled('project');
$tabcond[30] = isModEnabled('label');
//$tabcond[31]= !empty($conf->accounting->enabled);
//$tabcond[31]= isModEnabled('accounting');
$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
$tabcond[33] = isModEnabled('hrm');
$tabcond[34] = isModEnabled('hrm');
@@ -2076,7 +2076,7 @@ if ($id > 0) {
} elseif (in_array($value, array('recuperableonly'))) {
$class = "center";
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
$tmpaccountingaccount = new AccountingAccount($db);
$tmpaccountingaccount->fetch(0, $valuetoshow, 1);
@@ -2485,7 +2485,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print '</td>';
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
print '<td>';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$fieldname = $value;
$accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
print $formaccounting->select_account($accountancy_account, '.'. $value, 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');

View File

@@ -530,7 +530,7 @@ if ($action == 'edit') {
}
} elseif ($val['type'] == 'accountancy_code') {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
$formaccounting = new FormAccounting($db);
print $formaccounting->select_account($selected, $constname, 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
@@ -539,7 +539,7 @@ if ($action == 'edit') {
}
} elseif ($val['type'] == 'accountancy_category') {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print '<input type="text" name="' . $constname . '" list="pcg_type_datalist" value="' . $selected . '">';
// autosuggest from existing account types if found
print '<datalist id="pcg_type_datalist">';
@@ -636,7 +636,7 @@ if ($action == 'edit') {
setEventMessages(null, $object->errors, "errors");
}
} elseif ($val['type'] == 'accountancy_code') {
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('', $conf->global->{$constname}, 1);

View File

@@ -34,7 +34,7 @@ if (!is_object($form)) {
$form = new Form($db);
}
if (!empty($conf->accounting->enabled) && !is_object($formaccounting)) {
if (isModEnabled('accounting') && !is_object($formaccounting)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
$formaccounting = new FormAccounting($db);
}
@@ -66,7 +66,7 @@ if (empty($reshook)) {
$html_name = $mode_key . '_' . $field_key;
print '<tr><td class="titlefieldcreate">' . $langs->trans($field_info['label']) . '</td><td colspan="3">';
$accountancy_code = GETPOSTISSET($html_name) ? GETPOST($html_name, 'aZ09') : (!empty($assetaccountancycodes->accountancy_codes[$mode_key][$field_key]) ? $assetaccountancycodes->accountancy_codes[$mode_key][$field_key] : '');
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print $formaccounting->select_account($accountancy_code, $html_name, 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
} else {
print '<input name="' . $html_name . '" class="maxwidth200" value="' . dol_escape_htmltag($accountancy_code) . '">';

View File

@@ -50,7 +50,7 @@ if ($reshook < 0) {
}
if (empty($reshook)) {
if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
if (isModEnabled('accounting')) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
foreach ($assetaccountancycodes->accountancy_codes_fields as $mode_key => $mode_info) {
//if (empty($object->enabled_modes[$mode_key])) continue;
@@ -63,7 +63,7 @@ if (empty($reshook)) {
print '<tr><td class="titlefieldcreate">' . $langs->trans($field_info['label']) . '</td><td colspan="3">';
if (!empty($assetaccountancycodes->accountancy_codes[$mode_key][$field_key])) {
$accountancy_code = $assetaccountancycodes->accountancy_codes[$mode_key][$field_key];
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('', $accountancy_code, 1);

View File

@@ -2272,7 +2272,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
}
// Add if object was dispatched "into accountancy"
if (!empty($conf->accounting->enabled) && in_array($object->element, array('bank', 'paiementcharge', 'facture', 'invoice', 'invoice_supplier', 'expensereport', 'payment_various'))) {
if (isModEnabled('accounting') && in_array($object->element, array('bank', 'paiementcharge', 'facture', 'invoice', 'invoice_supplier', 'expensereport', 'payment_various'))) {
// Note: For 'chargesociales', 'salaries'... this is the payments that are dispatched (so element = 'bank')
if (method_exists($object, 'getVentilExportCompta')) {
$accounted = $object->getVentilExportCompta();