33 require
'../../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
39 $langs->loadLangs(array(
"compta",
"bills",
"admin",
"accountancy",
"other"));
42 if (!$user->hasRight(
'accounting',
'chartofaccount')) {
46 $action =
GETPOST(
'action',
'aZ09');
50 'ACCOUNTING_LENGTH_GACCOUNT',
51 'ACCOUNTING_LENGTH_AACCOUNT',
57 $list_binding = array(
58 'ACCOUNTING_DATE_START_BINDING',
59 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER'
69 if (in_array($action, array(
70 'setBANK_DISABLE_DIRECT_INPUT',
71 'setACCOUNTANCY_COMBO_FOR_AUX',
72 'setACCOUNTING_MANAGE_ZERO',
73 'setACCOUNTING_LIST_SORT_VENTILATION_TODO',
74 'setACCOUNTING_LIST_SORT_VENTILATION_DONE'))) {
75 $constname = preg_replace(
'/^set/',
'', $action);
76 $constvalue =
GETPOST(
'value',
'int');
77 $res =
dolibarr_set_const($db, $constname, $constvalue,
'yesno', 0,
'', $conf->entity);
89 if ($action ==
'update') {
93 foreach ($list as $constname) {
94 $constvalue =
GETPOST($constname,
'alpha');
95 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
103 foreach ($list_binding as $constname) {
104 $constvalue =
GETPOST($constname,
'alpha');
106 if ($constname ==
'ACCOUNTING_DATE_START_BINDING') {
110 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
124 if ($action ==
'setlistsorttodo') {
125 $setlistsorttodo =
GETPOST(
'value',
'int');
126 $res =
dolibarr_set_const($db,
"ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo,
'yesno', 0,
'', $conf->entity);
138 if ($action ==
'setlistsortdone') {
139 $setlistsortdone =
GETPOST(
'value',
'int');
140 $res =
dolibarr_set_const($db,
"ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone,
'yesno', 0,
'', $conf->entity);
152 if ($action ==
'setmanagezero') {
153 $setmanagezero =
GETPOST(
'value',
'int');
154 $res =
dolibarr_set_const($db,
"ACCOUNTING_MANAGE_ZERO", $setmanagezero,
'yesno', 0,
'', $conf->entity);
166 if ($action ==
'setdisabledirectinput') {
167 $setdisabledirectinput =
GETPOST(
'value',
'int');
168 $res =
dolibarr_set_const($db,
"BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput,
'yesno', 0,
'', $conf->entity);
180 if ($action ==
'setenabledraftexport') {
181 $setenabledraftexport =
GETPOST(
'value',
'int');
182 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport,
'yesno', 0,
'', $conf->entity);
194 if ($action ==
'setenablesubsidiarylist') {
195 $setenablesubsidiarylist =
GETPOST(
'value',
'int');
196 $res =
dolibarr_set_const($db,
"ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist,
'yesno', 0,
'', $conf->entity);
208 if ($action ==
'setdisablebindingonsales') {
209 $setdisablebindingonsales =
GETPOST(
'value',
'int');
210 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales,
'yesno', 0,
'', $conf->entity);
222 if ($action ==
'setdisablebindingonpurchases') {
223 $setdisablebindingonpurchases =
GETPOST(
'value',
'int');
224 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases,
'yesno', 0,
'', $conf->entity);
236 if ($action ==
'setdisablebindingonexpensereports') {
237 $setdisablebindingonexpensereports =
GETPOST(
'value',
'int');
238 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports,
'yesno', 0,
'', $conf->entity);
250 if ($action ==
'setenablelettering') {
251 $setenablelettering =
GETPOST(
'value',
'int');
252 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_LETTERING", $setenablelettering,
'yesno', 0,
'', $conf->entity);
271 $title = $langs->trans(
'ConfigAccountingExpert');
280 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
281 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
283 if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
284 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
286 if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
287 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") .
'</div>';
289 if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
290 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_COMPANY_PERENTITY_SHARED") .
'</div>';
292 if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
293 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_PRODUCT_PERENTITY_SHARED") .
'</div>';
297 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
298 print
'<input type="hidden" name="token" value="'.newToken().
'">';
299 print
'<input type="hidden" name="action" value="update">';
302 print
'<table class="noborder centpercent">';
303 print
'<tr class="liste_titre">';
304 print
'<td colspan="2">'.$langs->trans(
'Options').
'</td>';
324 print
'<tr class="oddeven">';
325 print
'<td>'.$langs->trans(
"BANK_DISABLE_DIRECT_INPUT").
'</td>';
326 if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
327 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
328 print
img_picto($langs->trans(
"Activated"),
'switch_on');
331 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
332 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
337 print
'<tr class="oddeven">';
338 print
'<td>'.$langs->trans(
"ACCOUNTANCY_COMBO_FOR_AUX");
339 print
' - <span class="opacitymedium">'.$langs->trans(
"NotRecommended").
'</span>';
342 if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
343 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=0">';
344 print
img_picto($langs->trans(
"Activated"),
'switch_on');
347 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=1">';
348 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
353 print
'<tr class="oddeven">';
354 print
'<td>'.$langs->trans(
"ACCOUNTING_MANAGE_ZERO").
'</td>';
355 if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
356 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_MANAGE_ZERO&value=0">';
357 print
img_picto($langs->trans(
"Activated"),
'switch_on');
360 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_MANAGE_ZERO&value=1">';
361 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
367 foreach ($list as $key) {
368 print
'<tr class="oddeven value">';
370 if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key ==
'ACCOUNTING_LENGTH_GACCOUNT' || $key ==
'ACCOUNTING_LENGTH_AACCOUNT')) {
375 $label = $langs->trans($key);
376 print
'<td>'.$label.
'</td>';
378 print
'<td class="right">';
379 print
'<input type="text" class="maxwidth50 right" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
388 print
'<table class="noborder centpercent">';
389 print
'<tr class="liste_titre">';
390 print
'<td colspan="2">'.$langs->trans(
'BindingOptions').
'</td>';
394 print
'<tr class="oddeven">';
395 print
'<td>'.$langs->trans(
"ACCOUNTING_LIST_SORT_VENTILATION_TODO").
'</td>';
396 if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
397 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=0">';
398 print
img_picto($langs->trans(
"Activated"),
'switch_on');
401 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=1">';
402 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
407 print
'<tr class="oddeven">';
408 print
'<td>'.$langs->trans(
"ACCOUNTING_LIST_SORT_VENTILATION_DONE").
'</td>';
409 if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
410 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=0">';
411 print
img_picto($langs->trans(
"Activated"),
'switch_on');
414 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=1">';
415 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
421 foreach ($list_binding as $key) {
422 print
'<tr class="oddeven value">';
425 $label = $langs->trans($key);
426 print
'<td>'.$label.
'</td>';
428 print
'<td class="right">';
429 if ($key ==
'ACCOUNTING_DATE_START_BINDING') {
430 print
$form->selectDate((!empty($conf->global->$key) ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1);
431 } elseif ($key ==
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
432 $array = array(0=>$langs->trans(
"PreviousMonth"), 1=>$langs->trans(
"CurrentMonth"), 2=>$langs->trans(
"Fiscalyear"));
433 print
$form->selectarray($key, $array, (isset($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER : 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage');
435 print
'<input type="text" class="maxwidth100" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
442 print
'<tr class="oddeven">';
443 print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_SALES").
'</td>';
444 if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
445 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonsales&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=setdisablebindingonsales&value=1">';
450 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
455 print
'<tr class="oddeven">';
456 print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").
'</td>';
457 if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
458 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonpurchases&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=setdisablebindingonpurchases&value=1">';
463 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
468 print
'<tr class="oddeven">';
469 print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").
'</td>';
470 if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
471 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonexpensereports&value=0">';
472 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'',
false, 0, 0,
'',
'warning');
475 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonexpensereports&value=1">';
476 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
484 print
'<table class="noborder centpercent">';
485 print
'<tr class="liste_titre">';
486 print
'<td colspan="2">'.$langs->trans(
'Options').
' '.$langs->trans(
'Lettering').
'</td>';
489 print
'<tr class="oddeven">';
490 print
'<td>'.$langs->trans(
"ACCOUNTING_ENABLE_LETTERING").
'</td>';
491 if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
492 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setenablelettering&value=0">';
493 print
img_picto($langs->trans(
"Activated"),
'switch_on');
496 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setenablelettering&value=1">';
497 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
504 print
'<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($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.