30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
34 $langs->loadLangs(array(
'admin',
'compta',
'accountancy'));
39 $action =
GETPOST(
'action',
'aZ09');
43 'ACCOUNTING_PRODUCT_BUY_ACCOUNT',
44 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',
45 'ACCOUNTING_SERVICE_BUY_ACCOUNT',
46 'ACCOUNTING_SERVICE_SOLD_ACCOUNT',
47 'ACCOUNTING_VAT_SOLD_ACCOUNT',
48 'ACCOUNTING_VAT_BUY_ACCOUNT',
49 'ACCOUNTING_ACCOUNT_CUSTOMER',
50 'ACCOUNTING_ACCOUNT_SUPPLIER'
57 $accounting_mode = empty($conf->global->ACCOUNTING_MODE) ?
'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE;
59 if ($action ==
'update')
63 $accounting_modes = array(
68 $accounting_mode =
GETPOST(
'accounting_mode',
'alpha');
71 if (in_array($accounting_mode, $accounting_modes)) {
72 if (!
dolibarr_set_const($db,
'ACCOUNTING_MODE', $accounting_mode,
'chaine', 0,
'', $conf->entity)) {
79 foreach ($list as $constname) {
80 $constvalue =
GETPOST($constname,
'alpha');
82 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
87 $report_include_varpay =
GETPOST(
'ACCOUNTING_REPORTS_INCLUDE_VARPAY',
'alpha');
88 if (!empty($report_include_varpay))
89 if ($report_include_varpay ==
'yes')
90 if (!
dolibarr_set_const($db,
'ACCOUNTING_REPORTS_INCLUDE_VARPAY', 1,
'chaine', 0,
'', $conf->entity)) $error++;
91 if ($report_include_varpay ==
'no')
92 if (!
dolibarr_del_const($db,
'ACCOUNTING_REPORTS_INCLUDE_VARPAY', $conf->entity)) $error++;
94 $report_include_loan =
GETPOST(
'ACCOUNTING_REPORTS_INCLUDE_LOAN',
'alpha');
95 if (!empty($report_include_loan))
96 if ($report_include_loan ==
'yes')
97 if (!
dolibarr_set_const($db,
'ACCOUNTING_REPORTS_INCLUDE_LOAN', 1,
'chaine', 0,
'', $conf->entity)) $error++;
98 if ($report_include_loan ==
'no')
99 if (!
dolibarr_del_const($db,
'ACCOUNTING_REPORTS_INCLUDE_LOAN', $conf->entity)) $error++;
115 $form =
new Form($db);
117 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
122 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
123 print
'<input type="hidden" name="token" value="'.newToken().
'">';
124 print
'<input type="hidden" name="action" value="update">';
126 print
'<table class="noborder centpercent">';
130 print
'<tr class="liste_titre">';
131 print
'<td>'.$langs->trans(
'OptionMode').
'</td><td>'.$langs->trans(
'Description').
'</td>';
133 print
'<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode !=
'CREANCES-DETTES' ?
' checked' :
'').
'> '.$langs->trans(
'OptionModeTrue').
'</td>';
134 print
'<td colspan="2">'.nl2br($langs->trans(
'OptionModeTrueDesc'));
146 print
"</td></tr>\n";
147 print
'<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode ==
'CREANCES-DETTES' ?
' checked' :
'').
'> '.$langs->trans(
'OptionModeVirtual').
'</td>';
148 print
'<td colspan="2">'.nl2br($langs->trans(
'OptionModeVirtualDesc')).
"</td></tr>\n";
154 print
'<table class="noborder centpercent">';
155 print
'<tr class="liste_titre">';
156 print
'<td colspan="3">'.$langs->trans(
'OtherOptions').
'</td>';
160 foreach ($list as $key)
162 print
'<tr class="oddeven value">';
165 $libelle = $langs->trans($key);
166 print
'<td><label for="'.$key.
'">'.$libelle.
'</label></td>';
170 print
'<input type="text" size="20" id="'.$key.
'" name="'.$key.
'" value="'.$conf->global->$key.
'">';
175 print
'<tr class="oddeven value">'.
"\n";
176 print
'<td><label for="ACCOUNTING_REPORTS_INCLUDE_VARPAY">'.$langs->trans(
'IncludeVarpaysInResults').
'</label></td>'.
"\n";
177 print
'<td class="center">'.
"\n";
178 print $form->selectyesno(
'ACCOUNTING_REPORTS_INCLUDE_VARPAY', (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY)));
182 print
'<tr class="oddeven value">'.
"\n";
183 print
'<td><label for="ACCOUNTING_REPORTS_INCLUDE_LOAN">'.$langs->trans(
'IncludeLoansInResults').
'</label></td>'.
"\n";
184 print
'<td class="center">'.
"\n";
185 print $form->selectyesno(
'ACCOUNTING_REPORTS_INCLUDE_LOAN', (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN)));
190 print
'<br><br><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans(
'Modify').
'" name="button"></div>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
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 ...
print
Draft customers invoices.