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 =
GETPOSTINT(
'ACCOUNTING_LETTERING_NBLETTERS');
52 'ACCOUNTING_LENGTH_GACCOUNT',
53 'ACCOUNTING_LENGTH_AACCOUNT',
57 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER',
58 'ACCOUNTING_DATE_START_BINDING',
68if (in_array($action, array(
'setBANK_DISABLE_DIRECT_INPUT',
'setACCOUNTANCY_ER_DATE_RECORD',
'setACCOUNTANCY_COMBO_FOR_AUX',
'setACCOUNTING_MANAGE_ZERO',
'setACCOUNTING_BANK_CONCILIATED'))) {
69 $constname = preg_replace(
'/^set/',
'', $action);
71 $res =
dolibarr_set_const($db, $constname, $constvalue,
'yesno', 0,
'', $conf->entity);
83if ($action ==
'update') {
87 foreach ($list as $constname) {
88 $constvalue =
GETPOST($constname,
'alpha');
89 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)) {
111 if (GETPOSTISSET(
'ACCOUNTING_LETTERING_NBLETTERS')) {
112 if (!
dolibarr_set_const($db,
'ACCOUNTING_LETTERING_NBLETTERS',
GETPOST(
'ACCOUNTING_LETTERING_NBLETTERS'),
'chaine', 0,
'', $conf->entity)) {
127if ($action ==
'setmanagezero') {
129 $res =
dolibarr_set_const($db,
"ACCOUNTING_MANAGE_ZERO", $setmanagezero,
'yesno', 0,
'', $conf->entity);
141if ($action ==
'setenabledraftexport') {
143 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport,
'yesno', 0,
'', $conf->entity);
155if ($action ==
'setenablesubsidiarylist') {
156 $setenablesubsidiarylist =
GETPOSTINT(
'value');
157 $res =
dolibarr_set_const($db,
"ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist,
'yesno', 0,
'', $conf->entity);
169if ($action ==
'setdisablebindingonsales') {
170 $setdisablebindingonsales =
GETPOSTINT(
'value');
171 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales,
'yesno', 0,
'', $conf->entity);
183if ($action ==
'setdisablebindingonpurchases') {
184 $setdisablebindingonpurchases =
GETPOSTINT(
'value');
185 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases,
'yesno', 0,
'', $conf->entity);
197if ($action ==
'setdisablebindingonexpensereports') {
198 $setdisablebindingonexpensereports =
GETPOSTINT(
'value');
199 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports,
'yesno', 0,
'', $conf->entity);
211if ($action ==
'setenablelettering') {
213 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_LETTERING", $setenablelettering,
'yesno', 0,
'', $conf->entity);
225if ($action ==
'setenableautolettering') {
226 $setenableautolettering =
GETPOSTINT(
'value');
227 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering,
'yesno', 0,
'', $conf->entity);
239if ($action ==
'setenablevatreversecharge') {
240 $setenablevatreversecharge =
GETPOSTINT(
'value');
241 $res =
dolibarr_set_const($db,
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge,
'yesno', 0,
'', $conf->entity);
258$form =
new Form($db);
260$title = $langs->trans(
'ConfigAccountingExpert');
261$help_url =
'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration';
274 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
277 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
280 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") .
'</div>';
283 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_COMPANY_PERENTITY_SHARED") .
'</div>';
286 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_PRODUCT_PERENTITY_SHARED") .
'</div>';
290print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
291print
'<input type="hidden" name="token" value="'.newToken().
'">';
292print
'<input type="hidden" name="action" value="update">';
295print
'<div class="div-table-responsive-no-min">';
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>';
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>';
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").
' - '.$langs->trans(
"NotRecommended"),
'switch_on',
'class="warning"');
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>';
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="number" class="maxwidth50 right" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
385print
'<div class="div-table-responsive-no-min">';
386print
'<table class="noborder centpercent">';
387print
'<tr class="liste_titre">';
388print
'<td colspan="2">'.$langs->trans(
'BindingOptions').
'</td>';
392foreach ($list_binding as $key) {
393 print
'<tr class="oddeven value">';
396 $label = $langs->trans($key);
397 print
'<td>'.$label.
'</td>';
399 print
'<td class="right minwidth75imp parentonrightofpage">';
400 if ($key ==
'ACCOUNTING_DATE_START_BINDING') {
402 } elseif ($key ==
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
403 $array = array(0=>$langs->trans(
"PreviousMonth"), 1=>$langs->trans(
"CurrentMonth"), 2=>$langs->trans(
"Fiscalyear"));
404 print $form->selectarray($key, $array,
getDolGlobalInt(
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage width200');
406 print
'<input type="text" class="maxwidth100" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
413print
'<tr class="oddeven">';
414print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_SALES").
'</td>';
416 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonsales&value=0">';
417 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
420 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonsales&value=1">';
421 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
426print
'<tr class="oddeven">';
427print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").
'</td>';
429 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonpurchases&value=0">';
430 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
433 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonpurchases&value=1">';
434 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
439print
'<tr class="oddeven">';
440print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").
'</td>';
442 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonexpensereports&value=0">';
443 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
446 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonexpensereports&value=1">';
447 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
453 print
'<tr class="oddeven">';
454 print
'<td>'.$langs->trans(
"ACCOUNTANCY_ER_DATE_RECORD").
'</td>';
456 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTANCY_ER_DATE_RECORD&value=0">';
457 print
img_picto($langs->trans(
"Activated"),
'switch_on');
460 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTANCY_ER_DATE_RECORD&value=1">';
461 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
467print
'<tr class="oddeven">';
468print
'<td>'.$langs->trans(
"ACCOUNTING_BANK_CONCILIATED").
'</td>';
470 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_BANK_CONCILIATED&value=1">';
471 print
img_picto($langs->trans(
"Activated"),
'switch_on');
474 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_BANK_CONCILIATED&value=2">';
475 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
490print
'<div class="div-table-responsive-no-min">';
491print
'<table class="noborder centpercent">';
492print
'<tr class="liste_titre">';
493print
'<td colspan="2">' . $langs->trans(
'OptionsAdvanced') .
'</td>';
496print
'<tr class="oddeven">';
498print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_LETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_LETTERING_DESC", $langs->transnoentitiesnoconv(
"NumMvts")).
'<br>'.$langs->trans(
"EnablingThisFeatureIsNotNecessary")).
'</td>';
500 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setenablelettering&value=0">';
501 print
img_picto($langs->trans(
"Activated"),
'switch_on');
504 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setenablelettering&value=1">';
505 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
512 print
'<tr class="oddeven">';
514 print $form->textwithpicto($langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS_DESC")) .
'</td>';
515 print
'<td class="right">';
517 if (empty($letter)) {
525 print
'<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter .
'" type="number" step="1" min="2" max="3" >' .
"\n";
529 print
'<tr class="oddeven">';
531 print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) .
'</td>';
533 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenableautolettering&value=0">';
534 print
img_picto($langs->trans(
"Activated"),
'switch_on');
537 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenableautolettering&value=1">';
538 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
544print
'<tr class="oddeven">';
546print $form->textwithpicto($langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities(
"MenuDefaultAccounts"))).
'</td>';
548 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenablevatreversecharge&value=0">';
549 print
img_picto($langs->trans(
"Activated"),
'switch_on');
552 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenablevatreversecharge&value=1">';
553 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
562print
'<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans(
'Save').
'"></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 information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.