32require
'../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
43$langs->loadLangs(array(
'admin',
'compta',
'accountancy'));
45$action =
GETPOST(
'action',
'aZ09');
49 'ACCOUNTING_PRODUCT_BUY_ACCOUNT',
50 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',
51 'ACCOUNTING_SERVICE_BUY_ACCOUNT',
52 'ACCOUNTING_SERVICE_SOLD_ACCOUNT',
53 'ACCOUNTING_VAT_SOLD_ACCOUNT',
54 'ACCOUNTING_VAT_BUY_ACCOUNT',
55 'ACCOUNTING_ACCOUNT_CUSTOMER',
56 'ACCOUNTING_ACCOUNT_SUPPLIER'
74if ($action ==
'update') {
77 $accounting_modes = array(
82 $accounting_mode =
GETPOST(
'accounting_mode',
'alpha');
85 if (in_array($accounting_mode, $accounting_modes)) {
86 if (!
dolibarr_set_const($db,
'ACCOUNTING_MODE', $accounting_mode,
'chaine', 0,
'', $conf->entity)) {
93 foreach ($list as $constname) {
94 $constvalue =
GETPOST($constname,
'alpha');
96 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
101 $report_include_varpay =
GETPOST(
'ACCOUNTING_REPORTS_INCLUDE_VARPAY',
'alpha');
102 if (!empty($report_include_varpay)) {
103 if ($report_include_varpay ==
'yes') {
104 if (!
dolibarr_set_const($db,
'ACCOUNTING_REPORTS_INCLUDE_VARPAY', 1,
'chaine', 0,
'', $conf->entity)) {
109 if ($report_include_varpay ==
'no') {
115 $report_include_loan =
GETPOST(
'ACCOUNTING_REPORTS_INCLUDE_LOAN',
'alpha');
116 if (!empty($report_include_loan)) {
117 if ($report_include_loan ==
'yes') {
118 if (!
dolibarr_set_const($db,
'ACCOUNTING_REPORTS_INCLUDE_LOAN', 1,
'chaine', 0,
'', $conf->entity)) {
123 if ($report_include_loan ==
'no') {
141llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-compta');
143$form =
new Form($db);
145$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
147print
load_fiche_titre($langs->trans(
'ComptaSetup'), $linkback,
'title_setup');
151print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
152print
'<input type="hidden" name="token" value="'.newToken().
'">';
153print
'<input type="hidden" name="action" value="update">';
155print
'<table class="noborder centpercent">';
159print
'<tr class="liste_titre">';
160print
'<td colspan="2">'.$langs->trans(
'OptionMode').
'</td>';
162print
'<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode !=
'RECETTES-DEPENSES' ?
' checked' :
'').
'><label for="accounting_mode_2"> '.$langs->trans(
'OptionModeVirtual').
'</label></td>';
163print
'<td class="opacitymedium">'.nl2br($langs->trans(
'OptionModeVirtualDesc')).
"</td></tr>\n";
164print
'<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_1" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode ==
'RECETTES-DEPENSES' ?
' checked' :
'').
'><label for="accounting_mode_1"> '.$langs->trans(
'OptionModeTrue').
'</label></td>';
165print
'<td class="opacitymedium">'.nl2br($langs->trans(
'OptionModeTrueDesc'));
172print
'<table class="noborder centpercent">';
173print
'<tr class="liste_titre">';
174print
'<td colspan="3">'.$langs->trans(
'OtherOptions').
'</td>';
193print
'<tr class="oddeven value">'.
"\n";
194print
'<td><label for="ACCOUNTING_REPORTS_INCLUDE_VARPAY">'.$langs->trans(
'IncludeVarpaysInResults').
'</label></td>'.
"\n";
195print
'<td class="center">'.
"\n";
196print $form->selectyesno(
'ACCOUNTING_REPORTS_INCLUDE_VARPAY', (
getDolGlobalString(
'ACCOUNTING_REPORTS_INCLUDE_VARPAY')));
200print
'<tr class="oddeven value">'.
"\n";
201print
'<td><label for="ACCOUNTING_REPORTS_INCLUDE_LOAN">'.$langs->trans(
'IncludeLoansInResults').
'</label></td>'.
"\n";
202print
'<td class="center">'.
"\n";
203print $form->selectyesno(
'ACCOUNTING_REPORTS_INCLUDE_LOAN', (
getDolGlobalString(
'ACCOUNTING_REPORTS_INCLUDE_LOAN')));
208print
'<br><br><div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans(
'Save').
'"></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.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.