31 require
'../../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT .
'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT .
'/core/lib/accounting.lib.php';
36 $langs->loadLangs(array(
"compta",
"bills",
"admin",
"accountancy"));
39 if (empty($user->rights->accounting->chartofaccount))
44 $action =
GETPOST(
'action',
'aZ09');
48 'ACCOUNTING_LENGTH_GACCOUNT',
49 'ACCOUNTING_LENGTH_AACCOUNT' ,
60 $accounting_mode = empty($conf->global->ACCOUNTING_MODE) ?
'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE;
62 if ($action ==
'update') {
67 foreach ($list as $constname)
69 $constvalue =
GETPOST($constname,
'alpha');
71 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
86 if ($action ==
'setlistsorttodo') {
87 $setlistsorttodo =
GETPOST(
'value',
'int');
88 $res =
dolibarr_set_const($db,
"ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo,
'yesno', 0,
'', $conf->entity);
99 if ($action ==
'setlistsortdone') {
100 $setlistsortdone =
GETPOST(
'value',
'int');
101 $res =
dolibarr_set_const($db,
"ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone,
'yesno', 0,
'', $conf->entity);
111 if ($action ==
'setmanagezero') {
112 $setmanagezero =
GETPOST(
'value',
'int');
113 $res =
dolibarr_set_const($db,
"ACCOUNTING_MANAGE_ZERO", $setmanagezero,
'yesno', 0,
'', $conf->entity);
123 if ($action ==
'setdisabledirectinput') {
124 $setdisabledirectinput =
GETPOST(
'value',
'int');
125 $res =
dolibarr_set_const($db,
"BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput,
'yesno', 0,
'', $conf->entity);
135 if ($action ==
'setenabledraftexport') {
136 $setenabledraftexport =
GETPOST(
'value',
'int');
137 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport,
'yesno', 0,
'', $conf->entity);
153 $form =
new Form($db);
158 print '<form action="' . $_SERVER[
"PHP_SELF"] .
'" method="post">';
159 print '<input type="hidden" name="token" value="' . $_SESSION[
'newtoken'] .
'">';
160 print '<input type="hidden" name="action" value="update">';
194 print '<table class="noborder" width="100%">';
195 print '<tr class="liste_titre">';
196 print '<td colspan="2">' . $langs->trans(
'OtherOptions') .
'</td>';
199 if (! empty($user->admin))
202 print '<tr class="oddeven">';
203 print '<td>' . $langs->trans(
"ACCOUNTING_LIST_SORT_VENTILATION_TODO") .
'</td>';
204 if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
205 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setlistsorttodo&value=0">';
209 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setlistsorttodo&value=1">';
215 print '<tr class="oddeven">';
216 print '<td>' . $langs->trans(
"ACCOUNTING_LIST_SORT_VENTILATION_DONE") .
'</td>';
217 if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
218 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setlistsortdone&value=0">';
222 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setlistsortdone&value=1">';
228 print '<tr class="oddeven">';
229 print '<td>' . $langs->trans(
"ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") .
'</td>';
230 if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
231 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setenabledraftexport&value=0">';
235 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setenabledraftexport&value=1">';
241 print '<tr class="oddeven">';
242 print '<td>' . $langs->trans(
"BANK_DISABLE_DIRECT_INPUT") .
'</td>';
243 if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
244 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setdisabledirectinput&value=0">';
248 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setdisabledirectinput&value=1">';
254 print '<tr class="oddeven">';
255 print '<td>' . $langs->trans(
"ACCOUNTING_MANAGE_ZERO") .
'</td>';
256 if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
257 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setmanagezero&value=0">';
261 print '<td align="right"><a href="' . $_SERVER[
'PHP_SELF'] .
'?action=setmanagezero&value=1">';
270 foreach ($list as $key)
272 print '<tr class="oddeven value">';
274 if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key ==
'ACCOUNTING_LENGTH_GACCOUNT' || $key ==
'ACCOUNTING_LENGTH_AACCOUNT'))
continue;
277 $label = $langs->trans($key);
278 print '<td>'.$label.
'</td>';
280 print '<td align="right">';
281 print '<input type="text" class="maxwidth100" id="' . $key .
'" name="' . $key .
'" value="' . $conf->global->$key .
'">';
290 print '<div class="center"><input type="submit" class="button" value="' . $langs->trans(
'Modify') .
'" name="button"></div>';
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
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).
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it's its name (generic function)