mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-15 14:01:22 +01:00
update code
This commit is contained in:
@@ -513,7 +513,7 @@ $tabcond[27] = isModEnabled("societe");
|
|||||||
$tabcond[28] = isModEnabled('holiday');
|
$tabcond[28] = isModEnabled('holiday');
|
||||||
$tabcond[29] = isModEnabled('project');
|
$tabcond[29] = isModEnabled('project');
|
||||||
$tabcond[30] = isModEnabled('label');
|
$tabcond[30] = isModEnabled('label');
|
||||||
//$tabcond[31]= !empty($conf->accounting->enabled);
|
//$tabcond[31]= isModEnabled('accounting');
|
||||||
$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
|
$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
|
||||||
$tabcond[33] = isModEnabled('hrm');
|
$tabcond[33] = isModEnabled('hrm');
|
||||||
$tabcond[34] = isModEnabled('hrm');
|
$tabcond[34] = isModEnabled('hrm');
|
||||||
@@ -2076,7 +2076,7 @@ if ($id > 0) {
|
|||||||
} elseif (in_array($value, array('recuperableonly'))) {
|
} elseif (in_array($value, array('recuperableonly'))) {
|
||||||
$class = "center";
|
$class = "center";
|
||||||
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
|
} 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';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
$tmpaccountingaccount = new AccountingAccount($db);
|
$tmpaccountingaccount = new AccountingAccount($db);
|
||||||
$tmpaccountingaccount->fetch(0, $valuetoshow, 1);
|
$tmpaccountingaccount->fetch(0, $valuetoshow, 1);
|
||||||
@@ -2485,7 +2485,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
|
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (!empty($conf->accounting->enabled)) {
|
if (isModEnabled('accounting')) {
|
||||||
$fieldname = $value;
|
$fieldname = $value;
|
||||||
$accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
|
$accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
|
||||||
print $formaccounting->select_account($accountancy_account, '.'. $value, 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
|
print $formaccounting->select_account($accountancy_account, '.'. $value, 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
|
||||||
|
|||||||
@@ -530,7 +530,7 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
} elseif ($val['type'] == 'accountancy_code') {
|
} elseif ($val['type'] == 'accountancy_code') {
|
||||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
$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';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
print $formaccounting->select_account($selected, $constname, 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
|
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') {
|
} elseif ($val['type'] == 'accountancy_category') {
|
||||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
$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 . '">';
|
print '<input type="text" name="' . $constname . '" list="pcg_type_datalist" value="' . $selected . '">';
|
||||||
// autosuggest from existing account types if found
|
// autosuggest from existing account types if found
|
||||||
print '<datalist id="pcg_type_datalist">';
|
print '<datalist id="pcg_type_datalist">';
|
||||||
@@ -636,7 +636,7 @@ if ($action == 'edit') {
|
|||||||
setEventMessages(null, $object->errors, "errors");
|
setEventMessages(null, $object->errors, "errors");
|
||||||
}
|
}
|
||||||
} elseif ($val['type'] == 'accountancy_code') {
|
} elseif ($val['type'] == 'accountancy_code') {
|
||||||
if (!empty($conf->accounting->enabled)) {
|
if (isModEnabled('accounting')) {
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||||
$accountingaccount = new AccountingAccount($db);
|
$accountingaccount = new AccountingAccount($db);
|
||||||
$accountingaccount->fetch('', $conf->global->{$constname}, 1);
|
$accountingaccount->fetch('', $conf->global->{$constname}, 1);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if (!is_object($form)) {
|
|||||||
$form = new Form($db);
|
$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';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ if (empty($reshook)) {
|
|||||||
$html_name = $mode_key . '_' . $field_key;
|
$html_name = $mode_key . '_' . $field_key;
|
||||||
print '<tr><td class="titlefieldcreate">' . $langs->trans($field_info['label']) . '</td><td colspan="3">';
|
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] : '');
|
$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);
|
print $formaccounting->select_account($accountancy_code, $html_name, 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<input name="' . $html_name . '" class="maxwidth200" value="' . dol_escape_htmltag($accountancy_code) . '">';
|
print '<input name="' . $html_name . '" class="maxwidth200" value="' . dol_escape_htmltag($accountancy_code) . '">';
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ if ($reshook < 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($reshook)) {
|
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) {
|
foreach ($assetaccountancycodes->accountancy_codes_fields as $mode_key => $mode_info) {
|
||||||
//if (empty($object->enabled_modes[$mode_key])) continue;
|
//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">';
|
print '<tr><td class="titlefieldcreate">' . $langs->trans($field_info['label']) . '</td><td colspan="3">';
|
||||||
if (!empty($assetaccountancycodes->accountancy_codes[$mode_key][$field_key])) {
|
if (!empty($assetaccountancycodes->accountancy_codes[$mode_key][$field_key])) {
|
||||||
$accountancy_code = $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 = new AccountingAccount($db);
|
||||||
$accountingaccount->fetch('', $accountancy_code, 1);
|
$accountingaccount->fetch('', $accountancy_code, 1);
|
||||||
|
|
||||||
|
|||||||
@@ -2272,7 +2272,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add if object was dispatched "into accountancy"
|
// 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')
|
// Note: For 'chargesociales', 'salaries'... this is the payments that are dispatched (so element = 'bank')
|
||||||
if (method_exists($object, 'getVentilExportCompta')) {
|
if (method_exists($object, 'getVentilExportCompta')) {
|
||||||
$accounted = $object->getVentilExportCompta();
|
$accounted = $object->getVentilExportCompta();
|
||||||
|
|||||||
Reference in New Issue
Block a user