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');
48$nbletter =
GETPOST(
'ACCOUNTING_LETTERING_NBLETTERS',
'int');
52 'ACCOUNTING_LENGTH_GACCOUNT',
53 'ACCOUNTING_LENGTH_AACCOUNT',
60 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER',
61 'ACCOUNTING_DATE_START_BINDING',
71if (in_array($action, array(
'setBANK_DISABLE_DIRECT_INPUT',
'setACCOUNTANCY_COMBO_FOR_AUX',
'setACCOUNTING_MANAGE_ZERO'))) {
72 $constname = preg_replace(
'/^set/',
'', $action);
73 $constvalue =
GETPOST(
'value',
'int');
74 $res =
dolibarr_set_const($db, $constname, $constvalue,
'yesno', 0,
'', $conf->entity);
86if ($action ==
'update') {
90 foreach ($list as $constname) {
91 $constvalue =
GETPOST($constname,
'alpha');
92 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
101 foreach ($list_binding as $constname) {
102 $constvalue =
GETPOST($constname,
'alpha');
104 if ($constname ==
'ACCOUNTING_DATE_START_BINDING') {
108 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
114 if (GETPOSTISSET(
'ACCOUNTING_LETTERING_NBLETTERS')) {
115 if (!
dolibarr_set_const($db,
'ACCOUNTING_LETTERING_NBLETTERS',
GETPOST(
'ACCOUNTING_LETTERING_NBLETTERS'),
'chaine', 0,
'', $conf->entity)) {
130if ($action ==
'setmanagezero') {
131 $setmanagezero =
GETPOST(
'value',
'int');
132 $res =
dolibarr_set_const($db,
"ACCOUNTING_MANAGE_ZERO", $setmanagezero,
'yesno', 0,
'', $conf->entity);
144if ($action ==
'setdisabledirectinput') {
145 $setdisabledirectinput =
GETPOST(
'value',
'int');
146 $res =
dolibarr_set_const($db,
"BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput,
'yesno', 0,
'', $conf->entity);
158if ($action ==
'setenabledraftexport') {
159 $setenabledraftexport =
GETPOST(
'value',
'int');
160 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport,
'yesno', 0,
'', $conf->entity);
172if ($action ==
'setenablesubsidiarylist') {
173 $setenablesubsidiarylist =
GETPOST(
'value',
'int');
174 $res =
dolibarr_set_const($db,
"ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist,
'yesno', 0,
'', $conf->entity);
186if ($action ==
'setdisablebindingonsales') {
187 $setdisablebindingonsales =
GETPOST(
'value',
'int');
188 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales,
'yesno', 0,
'', $conf->entity);
200if ($action ==
'setdisablebindingonpurchases') {
201 $setdisablebindingonpurchases =
GETPOST(
'value',
'int');
202 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases,
'yesno', 0,
'', $conf->entity);
214if ($action ==
'setdisablebindingonexpensereports') {
215 $setdisablebindingonexpensereports =
GETPOST(
'value',
'int');
216 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports,
'yesno', 0,
'', $conf->entity);
228if ($action ==
'setenablelettering') {
229 $setenablelettering =
GETPOST(
'value',
'int');
230 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_LETTERING", $setenablelettering,
'yesno', 0,
'', $conf->entity);
242if ($action ==
'setenableautolettering') {
243 $setenableautolettering =
GETPOST(
'value',
'int');
244 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering,
'yesno', 0,
'', $conf->entity);
256if ($action ==
'setenablevatreversecharge') {
257 $setenablevatreversecharge =
GETPOST(
'value',
'int');
258 $res =
dolibarr_set_const($db,
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge,
'yesno', 0,
'', $conf->entity);
275$form =
new Form($db);
277$title = $langs->trans(
'ConfigAccountingExpert');
278$help_url =
'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration';
291 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
294 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
297 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") .
'</div>';
300 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_COMPANY_PERENTITY_SHARED") .
'</div>';
303 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_PRODUCT_PERENTITY_SHARED") .
'</div>';
307print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
308print
'<input type="hidden" name="token" value="'.newToken().
'">';
309print
'<input type="hidden" name="action" value="update">';
312print
'<div class="div-table-responsive-no-min">';
313print
'<table class="noborder centpercent">';
314print
'<tr class="liste_titre">';
315print
'<td colspan="2">'.$langs->trans(
'Options').
'</td>';
335print
'<tr class="oddeven">';
336print
'<td>'.$langs->trans(
"BANK_DISABLE_DIRECT_INPUT").
'</td>';
338 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
339 print
img_picto($langs->trans(
"Activated"),
'switch_on');
342 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
343 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
348print
'<tr class="oddeven">';
349print
'<td>'.$langs->trans(
"ACCOUNTANCY_COMBO_FOR_AUX");
350print
' - <span class="opacitymedium">'.$langs->trans(
"NotRecommended").
'</span>';
354 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=0">';
355 print
img_picto($langs->trans(
"Activated"),
'switch_on');
358 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=1">';
359 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
364print
'<tr class="oddeven">';
365print
'<td>'.$langs->trans(
"ACCOUNTING_MANAGE_ZERO").
'</td>';
367 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTING_MANAGE_ZERO&value=0">';
368 print
img_picto($langs->trans(
"Activated"),
'switch_on');
371 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTING_MANAGE_ZERO&value=1">';
372 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
378foreach ($list as $key) {
379 print
'<tr class="oddeven value">';
381 if (
getDolGlobalInt(
'ACCOUNTING_MANAGE_ZERO') && ($key ==
'ACCOUNTING_LENGTH_GACCOUNT' || $key ==
'ACCOUNTING_LENGTH_AACCOUNT')) {
386 $label = $langs->trans($key);
387 print
'<td>'.$label.
'</td>';
389 print
'<td class="right">';
390 print
'<input type="text" class="maxwidth50 right" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
401print
'<div class="div-table-responsive-no-min">';
402print
'<table class="noborder centpercent">';
403print
'<tr class="liste_titre">';
404print
'<td colspan="2">'.$langs->trans(
'BindingOptions').
'</td>';
408foreach ($list_binding as $key) {
409 print
'<tr class="oddeven value">';
412 $label = $langs->trans($key);
413 print
'<td>'.$label.
'</td>';
415 print
'<td class="right minwidth75imp parentonrightofpage">';
416 if ($key ==
'ACCOUNTING_DATE_START_BINDING') {
418 } elseif ($key ==
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
419 $array = array(0=>$langs->trans(
"PreviousMonth"), 1=>$langs->trans(
"CurrentMonth"), 2=>$langs->trans(
"Fiscalyear"));
420 print $form->selectarray($key, $array,
getDolGlobalInt(
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage width200');
422 print
'<input type="text" class="maxwidth100" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
429print
'<tr class="oddeven">';
430print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_SALES").
'</td>';
432 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonsales&value=0">';
433 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
436 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonsales&value=1">';
437 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
442print
'<tr class="oddeven">';
443print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").
'</td>';
445 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonpurchases&value=0">';
446 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
449 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonpurchases&value=1">';
450 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
455print
'<tr class="oddeven">';
456print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").
'</td>';
458 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonexpensereports&value=0">';
459 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
462 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonexpensereports&value=1">';
463 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
478print
'<div class="div-table-responsive-no-min">';
479print
'<table class="noborder centpercent">';
480print
'<tr class="liste_titre">';
481print
'<td colspan="2">' . $langs->trans(
'OptionsAdvanced') .
'</td>';
484print
'<tr class="oddeven">';
486print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_LETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_LETTERING_DESC", $langs->transnoentitiesnoconv(
"NumMvts")).
'<br>'.$langs->trans(
"EnablingThisFeatureIsNotNecessary")).
'</td>';
488 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setenablelettering&value=0">';
489 print
img_picto($langs->trans(
"Activated"),
'switch_on');
492 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setenablelettering&value=1">';
493 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
500 print
'<tr class="oddeven">';
502 print $form->textwithpicto($langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS_DESC")) .
'</td>';
503 print
'<td class="right">';
505 if (empty($letter)) {
513 print
'<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter .
'" type="number" step="1" min="2" max="3" >' .
"\n";
517 print
'<tr class="oddeven">';
519 print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) .
'</td>';
521 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenableautolettering&value=0">';
522 print
img_picto($langs->trans(
"Activated"),
'switch_on');
525 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenableautolettering&value=1">';
526 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
532print
'<tr class="oddeven">';
534print $form->textwithpicto($langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities(
"MenuDefaultAccounts"))).
'</td>';
536 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenablevatreversecharge&value=0">';
537 print
img_picto($langs->trans(
"Activated"),
'switch_on');
540 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenablevatreversecharge&value=1">';
541 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
550print
'<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 a 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.