Go to the documentation of this file.
25 require
'../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
31 $langs->loadLangs(array(
"compta",
"admin",
"accountancy"));
34 if (empty($user->rights->accounting->chartofaccount)) {
38 $action =
GETPOST(
'action',
'aZ09');
41 $list_account_main = array(
42 'ACCOUNTING_RESULT_PROFIT',
43 'ACCOUNTING_RESULT_LOSS'
50 if ($action ==
'update') {
53 $defaultjournal =
GETPOST(
'ACCOUNTING_CLOSURE_DEFAULT_JOURNAL',
'alpha');
55 if (!empty($defaultjournal)) {
56 if (!
dolibarr_set_const($db,
'ACCOUNTING_CLOSURE_DEFAULT_JOURNAL', $defaultjournal,
'chaine', 0,
'', $conf->entity)) {
63 foreach ($list_account_main as $constname) {
64 $constvalue =
GETPOST($constname,
'alpha');
65 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
88 print
load_fiche_titre($langs->trans(
'MenuClosureAccounts'), $linkback,
'title_accountancy');
90 print
'<span class="opacitymedium">'.$langs->trans(
"DefaultClosureDesc").
'</span><br>';
93 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
94 print
'<input type="hidden" name="token" value="'.newToken().
'">';
95 print
'<input type="hidden" name="action" value="update">';
98 print
'<table class="noborder centpercent">';
100 foreach ($list_account_main as $key) {
101 print
'<tr class="oddeven value">';
103 $label = $langs->trans($key);
104 $keydesc = $key.
'_Desc';
106 $htmltext = $langs->trans($keydesc);
107 print
'<td class="fieldrequired" width="50%">';
108 print
$form->textwithpicto($label, $htmltext);
118 print
'<tr class="oddeven">';
119 print
'<td width="50%">'.$langs->trans(
"ACCOUNTING_CLOSURE_DEFAULT_JOURNAL").
'</td>';
121 $defaultjournal = $conf->global->ACCOUNTING_CLOSURE_DEFAULT_JOURNAL;
122 print $formaccounting->select_journal($defaultjournal,
"ACCOUNTING_CLOSURE_DEFAULT_JOURNAL", 9, 1, 0, 0);
127 print
'<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans(
'Modify').
'"></div>';
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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).
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.