31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
35$langs->loadLangs(array(
'admin',
'compta',
'accountancy'));
41$action =
GETPOST(
'action',
'aZ09');
45 'ACCOUNTING_PRODUCT_BUY_ACCOUNT',
46 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',
47 'ACCOUNTING_SERVICE_BUY_ACCOUNT',
48 'ACCOUNTING_SERVICE_SOLD_ACCOUNT',
49 'ACCOUNTING_VAT_SOLD_ACCOUNT',
50 'ACCOUNTING_VAT_BUY_ACCOUNT',
51 'ACCOUNTING_ACCOUNT_CUSTOMER',
52 'ACCOUNTING_ACCOUNT_SUPPLIER'
61if ($action ==
'update') {
64 $accounting_modes = array(
69 $accounting_mode =
GETPOST(
'accounting_mode',
'alpha');
72 if (in_array($accounting_mode, $accounting_modes)) {
73 if (!
dolibarr_set_const($db,
'ACCOUNTING_MODE', $accounting_mode,
'chaine', 0,
'', $conf->entity)) {
80 foreach ($list as $constname) {
81 $constvalue =
GETPOST($constname,
'alpha');
83 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
88 $report_include_varpay =
GETPOST(
'ACCOUNTING_REPORTS_INCLUDE_VARPAY',
'alpha');
89 if (!empty($report_include_varpay)) {
90 if ($report_include_varpay ==
'yes') {
91 if (!
dolibarr_set_const($db,
'ACCOUNTING_REPORTS_INCLUDE_VARPAY', 1,
'chaine', 0,
'', $conf->entity)) {
96 if ($report_include_varpay ==
'no') {
102 $report_include_loan =
GETPOST(
'ACCOUNTING_REPORTS_INCLUDE_LOAN',
'alpha');
103 if (!empty($report_include_loan)) {
104 if ($report_include_loan ==
'yes') {
105 if (!
dolibarr_set_const($db,
'ACCOUNTING_REPORTS_INCLUDE_LOAN', 1,
'chaine', 0,
'', $conf->entity)) {
110 if ($report_include_loan ==
'no') {
127llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-compta');
129$form =
new Form($db);
131$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
132print
load_fiche_titre($langs->trans(
'ComptaSetup'), $linkback,
'title_setup');
136print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
137print
'<input type="hidden" name="token" value="'.newToken().
'">';
138print
'<input type="hidden" name="action" value="update">';
140print
'<table class="noborder centpercent">';
144print
'<tr class="liste_titre">';
145print
'<td>'.$langs->trans(
'OptionMode').
'</td><td>'.$langs->trans(
'Description').
'</td>';
147print
'<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode !=
'CREANCES-DETTES' ?
' checked' :
'').
'> '.$langs->trans(
'OptionModeTrue').
'</td>';
148print
'<td colspan="2">'.nl2br($langs->trans(
'OptionModeTrueDesc'));
150print
'<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode ==
'CREANCES-DETTES' ?
' checked' :
'').
'> '.$langs->trans(
'OptionModeVirtual').
'</td>';
151print
'<td colspan="2">'.nl2br($langs->trans(
'OptionModeVirtualDesc')).
"</td></tr>\n";
157print
'<table class="noborder centpercent">';
158print
'<tr class="liste_titre">';
159print
'<td colspan="3">'.$langs->trans(
'OtherOptions').
'</td>';
163foreach ($list as $key) {
164 print
'<tr class="oddeven value">';
167 $libelle = $langs->trans($key);
168 print
'<td><label for="'.$key.
'">'.$libelle.
'</label></td>';
172 print
'<input type="text" size="20" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
177print
'<tr class="oddeven value">'.
"\n";
178print
'<td><label for="ACCOUNTING_REPORTS_INCLUDE_VARPAY">'.$langs->trans(
'IncludeVarpaysInResults').
'</label></td>'.
"\n";
179print
'<td class="center">'.
"\n";
180print $form->selectyesno(
'ACCOUNTING_REPORTS_INCLUDE_VARPAY', (
getDolGlobalString(
'ACCOUNTING_REPORTS_INCLUDE_VARPAY')));
184print
'<tr class="oddeven value">'.
"\n";
185print
'<td><label for="ACCOUNTING_REPORTS_INCLUDE_LOAN">'.$langs->trans(
'IncludeLoansInResults').
'</label></td>'.
"\n";
186print
'<td class="center">'.
"\n";
187print $form->selectyesno(
'ACCOUNTING_REPORTS_INCLUDE_LOAN', (
getDolGlobalString(
'ACCOUNTING_REPORTS_INCLUDE_LOAN')));
192print
'<br><br><div style="text-align: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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a 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.