33require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
39$langs->loadLangs(array(
"compta",
"bills",
"admin",
"accountancy",
"other"));
42if (!$user->hasRight(
'accounting',
'chartofaccount')) {
46$action =
GETPOST(
'action',
'aZ09');
50 'ACCOUNTING_LENGTH_GACCOUNT',
51 'ACCOUNTING_LENGTH_AACCOUNT',
58 'ACCOUNTING_DATE_START_BINDING',
59 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER'
69if (in_array($action, array(
'setBANK_DISABLE_DIRECT_INPUT',
'setACCOUNTANCY_COMBO_FOR_AUX',
'setACCOUNTING_MANAGE_ZERO'))) {
70 $constname = preg_replace(
'/^set/',
'', $action);
71 $constvalue =
GETPOST(
'value',
'int');
72 $res =
dolibarr_set_const($db, $constname, $constvalue,
'yesno', 0,
'', $conf->entity);
84if ($action ==
'update') {
88 foreach ($list as $constname) {
89 $constvalue =
GETPOST($constname,
'alpha');
90 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
98 foreach ($list_binding as $constname) {
99 $constvalue =
GETPOST($constname,
'alpha');
101 if ($constname ==
'ACCOUNTING_DATE_START_BINDING') {
105 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
119if ($action ==
'setmanagezero') {
120 $setmanagezero =
GETPOST(
'value',
'int');
121 $res =
dolibarr_set_const($db,
"ACCOUNTING_MANAGE_ZERO", $setmanagezero,
'yesno', 0,
'', $conf->entity);
133if ($action ==
'setdisabledirectinput') {
134 $setdisabledirectinput =
GETPOST(
'value',
'int');
135 $res =
dolibarr_set_const($db,
"BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput,
'yesno', 0,
'', $conf->entity);
147if ($action ==
'setenabledraftexport') {
148 $setenabledraftexport =
GETPOST(
'value',
'int');
149 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport,
'yesno', 0,
'', $conf->entity);
161if ($action ==
'setenablesubsidiarylist') {
162 $setenablesubsidiarylist =
GETPOST(
'value',
'int');
163 $res =
dolibarr_set_const($db,
"ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist,
'yesno', 0,
'', $conf->entity);
175if ($action ==
'setdisablebindingonsales') {
176 $setdisablebindingonsales =
GETPOST(
'value',
'int');
177 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales,
'yesno', 0,
'', $conf->entity);
189if ($action ==
'setdisablebindingonpurchases') {
190 $setdisablebindingonpurchases =
GETPOST(
'value',
'int');
191 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases,
'yesno', 0,
'', $conf->entity);
203if ($action ==
'setdisablebindingonexpensereports') {
204 $setdisablebindingonexpensereports =
GETPOST(
'value',
'int');
205 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports,
'yesno', 0,
'', $conf->entity);
217if ($action ==
'setenablelettering') {
218 $setenablelettering =
GETPOST(
'value',
'int');
219 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_LETTERING", $setenablelettering,
'yesno', 0,
'', $conf->entity);
231if ($action ==
'setenableautolettering') {
232 $setenableautolettering =
GETPOST(
'value',
'int');
233 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering,
'yesno', 0,
'', $conf->entity);
245if ($action ==
'setenablevatreversecharge') {
246 $setenablevatreversecharge =
GETPOST(
'value',
'int');
247 $res =
dolibarr_set_const($db,
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge,
'yesno', 0,
'', $conf->entity);
263$form =
new Form($db);
265$title = $langs->trans(
'ConfigAccountingExpert');
274 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
275 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
277 if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
278 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
280 if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
281 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") .
'</div>';
283 if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
284 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_COMPANY_PERENTITY_SHARED") .
'</div>';
286 if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
287 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_PRODUCT_PERENTITY_SHARED") .
'</div>';
291print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
292print
'<input type="hidden" name="token" value="'.newToken().
'">';
293print
'<input type="hidden" name="action" value="update">';
296print
'<table class="noborder centpercent">';
297print
'<tr class="liste_titre">';
298print
'<td colspan="2">'.$langs->trans(
'Options').
'</td>';
318print
'<tr class="oddeven">';
319print
'<td>'.$langs->trans(
"BANK_DISABLE_DIRECT_INPUT").
'</td>';
320if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
321 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
322 print
img_picto($langs->trans(
"Activated"),
'switch_on');
325 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
326 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
331print
'<tr class="oddeven">';
332print
'<td>'.$langs->trans(
"ACCOUNTANCY_COMBO_FOR_AUX");
333print
' - <span class="opacitymedium">'.$langs->trans(
"NotRecommended").
'</span>';
336if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
337 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=0">';
338 print
img_picto($langs->trans(
"Activated"),
'switch_on');
341 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=1">';
342 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
347print
'<tr class="oddeven">';
348print
'<td>'.$langs->trans(
"ACCOUNTING_MANAGE_ZERO").
'</td>';
349if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
350 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTING_MANAGE_ZERO&value=0">';
351 print
img_picto($langs->trans(
"Activated"),
'switch_on');
354 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTING_MANAGE_ZERO&value=1">';
355 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
361foreach ($list as $key) {
362 print
'<tr class="oddeven value">';
364 if (
getDolGlobalInt(
'ACCOUNTING_MANAGE_ZERO') && ($key ==
'ACCOUNTING_LENGTH_GACCOUNT' || $key ==
'ACCOUNTING_LENGTH_AACCOUNT')) {
369 $label = $langs->trans($key);
370 print
'<td>'.$label.
'</td>';
372 print
'<td class="right">';
373 print
'<input type="text" class="maxwidth50 right" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
382print
'<table class="noborder centpercent">';
383print
'<tr class="liste_titre">';
384print
'<td colspan="2">'.$langs->trans(
'BindingOptions').
'</td>';
388foreach ($list_binding as $key) {
389 print
'<tr class="oddeven value">';
392 $label = $langs->trans($key);
393 print
'<td>'.$label.
'</td>';
395 print
'<td class="right">';
396 if ($key ==
'ACCOUNTING_DATE_START_BINDING') {
398 } elseif ($key ==
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
399 $array = array(0=>$langs->trans(
"PreviousMonth"), 1=>$langs->trans(
"CurrentMonth"), 2=>$langs->trans(
"Fiscalyear"));
400 print $form->selectarray($key, $array,
getDolGlobalInt(
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage');
402 print
'<input type="text" class="maxwidth100" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
409print
'<tr class="oddeven">';
410print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_SALES").
'</td>';
411if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
412 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonsales&value=0">';
413 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
416 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonsales&value=1">';
417 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
422print
'<tr class="oddeven">';
423print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").
'</td>';
424if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
425 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonpurchases&value=0">';
426 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
429 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonpurchases&value=1">';
430 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
435print
'<tr class="oddeven">';
436print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").
'</td>';
437if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
438 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonexpensereports&value=0">';
439 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
442 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonexpensereports&value=1">';
443 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
457print
'<table class="noborder centpercent">';
458print
'<tr class="liste_titre">';
459print
'<td colspan="2">' . $langs->trans(
'OptionsAdvanced') .
'</td>';
462print
'<tr class="oddeven">';
464print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_LETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_LETTERING_DESC", $langs->transnoentitiesnoconv(
"NumMvts")).
'<br>'.$langs->trans(
"EnablingThisFeatureIsNotNecessary")).
'</td>';
465if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
466 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setenablelettering&value=0">';
467 print
img_picto($langs->trans(
"Activated"),
'switch_on');
470 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setenablelettering&value=1">';
471 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
476if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
477 print
'<tr class="oddeven">';
479 print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) .
'</td>';
480 if (!empty($conf->global->ACCOUNTING_ENABLE_AUTOLETTERING)) {
481 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenableautolettering&value=0">';
482 print
img_picto($langs->trans(
"Activated"),
'switch_on');
485 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenableautolettering&value=1">';
486 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
492print
'<tr class="oddeven">';
494print $form->textwithpicto($langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities(
"MenuDefaultAccounts"))).
'</td>';
495if (!empty($conf->global->ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE)) {
496 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenablevatreversecharge&value=0">';
497 print
img_picto($langs->trans(
"Activated"),
'switch_on');
500 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenablevatreversecharge&value=1">';
501 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
509print
'<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans(
'Modify').
'"></div>';
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.