index.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <?php
  2. /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
  3. * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
  4. * Copyright (C) 2013-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
  5. * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
  6. * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
  7. * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
  8. * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
  9. * Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr>
  10. * Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  24. */
  25. /**
  26. * \file htdocs/accountancy/admin/index.php
  27. * \ingroup Accountancy (Double entries)
  28. * \brief Setup page to configure accounting expert module
  29. */
  30. // Load Dolibarr environment
  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';
  34. require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
  35. // Load translation files required by the page
  36. $langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
  37. // Security access
  38. if (!$user->hasRight('accounting', 'chartofaccount')) {
  39. accessforbidden();
  40. }
  41. $action = GETPOST('action', 'aZ09');
  42. // Parameters ACCOUNTING_* and others
  43. $list = array(
  44. 'ACCOUNTING_LENGTH_GACCOUNT',
  45. 'ACCOUNTING_LENGTH_AACCOUNT',
  46. // 'ACCOUNTING_LIMIT_LIST_VENTILATION' // there is already a global parameter to define the nb of records in lists, we must use it in priority. Having one parameter for nb of record for each page is deprecated.
  47. // 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
  48. // 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
  49. );
  50. $list_binding = array(
  51. 'ACCOUNTING_DATE_START_BINDING',
  52. 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER'
  53. );
  54. $error = 0;
  55. /*
  56. * Actions
  57. */
  58. if (in_array($action, array('setBANK_DISABLE_DIRECT_INPUT', 'setACCOUNTANCY_COMBO_FOR_AUX', 'setACCOUNTING_MANAGE_ZERO'))) {
  59. $constname = preg_replace('/^set/', '', $action);
  60. $constvalue = GETPOST('value', 'int');
  61. $res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity);
  62. if (!($res > 0)) {
  63. $error++;
  64. }
  65. if (!$error) {
  66. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  67. } else {
  68. setEventMessages($langs->trans("Error"), null, 'mesgs');
  69. }
  70. }
  71. if ($action == 'update') {
  72. $error = 0;
  73. if (!$error) {
  74. foreach ($list as $constname) {
  75. $constvalue = GETPOST($constname, 'alpha');
  76. if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
  77. $error++;
  78. }
  79. }
  80. if ($error) {
  81. setEventMessages($langs->trans("Error"), null, 'errors');
  82. }
  83. foreach ($list_binding as $constname) {
  84. $constvalue = GETPOST($constname, 'alpha');
  85. if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
  86. $constvalue = dol_mktime(0, 0, 0, GETPOST($constname.'month', 'int'), GETPOST($constname.'day', 'int'), GETPOST($constname.'year', 'int'));
  87. }
  88. if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
  89. $error++;
  90. }
  91. }
  92. if ($error) {
  93. setEventMessages($langs->trans("Error"), null, 'errors');
  94. }
  95. }
  96. if (!$error) {
  97. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  98. }
  99. }
  100. if ($action == 'setmanagezero') {
  101. $setmanagezero = GETPOST('value', 'int');
  102. $res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
  103. if (!($res > 0)) {
  104. $error++;
  105. }
  106. if (!$error) {
  107. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  108. } else {
  109. setEventMessages($langs->trans("Error"), null, 'mesgs');
  110. }
  111. }
  112. if ($action == 'setdisabledirectinput') {
  113. $setdisabledirectinput = GETPOST('value', 'int');
  114. $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
  115. if (!($res > 0)) {
  116. $error++;
  117. }
  118. if (!$error) {
  119. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  120. } else {
  121. setEventMessages($langs->trans("Error"), null, 'mesgs');
  122. }
  123. }
  124. if ($action == 'setenabledraftexport') {
  125. $setenabledraftexport = GETPOST('value', 'int');
  126. $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
  127. if (!($res > 0)) {
  128. $error++;
  129. }
  130. if (!$error) {
  131. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  132. } else {
  133. setEventMessages($langs->trans("Error"), null, 'mesgs');
  134. }
  135. }
  136. if ($action == 'setenablesubsidiarylist') {
  137. $setenablesubsidiarylist = GETPOST('value', 'int');
  138. $res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity);
  139. if (!($res > 0)) {
  140. $error++;
  141. }
  142. if (!$error) {
  143. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  144. } else {
  145. setEventMessages($langs->trans("Error"), null, 'mesgs');
  146. }
  147. }
  148. if ($action == 'setdisablebindingonsales') {
  149. $setdisablebindingonsales = GETPOST('value', 'int');
  150. $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity);
  151. if (!($res > 0)) {
  152. $error++;
  153. }
  154. if (!$error) {
  155. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  156. } else {
  157. setEventMessages($langs->trans("Error"), null, 'mesgs');
  158. }
  159. }
  160. if ($action == 'setdisablebindingonpurchases') {
  161. $setdisablebindingonpurchases = GETPOST('value', 'int');
  162. $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity);
  163. if (!($res > 0)) {
  164. $error++;
  165. }
  166. if (!$error) {
  167. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  168. } else {
  169. setEventMessages($langs->trans("Error"), null, 'mesgs');
  170. }
  171. }
  172. if ($action == 'setdisablebindingonexpensereports') {
  173. $setdisablebindingonexpensereports = GETPOST('value', 'int');
  174. $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity);
  175. if (!($res > 0)) {
  176. $error++;
  177. }
  178. if (!$error) {
  179. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  180. } else {
  181. setEventMessages($langs->trans("Error"), null, 'mesgs');
  182. }
  183. }
  184. if ($action == 'setenablelettering') {
  185. $setenablelettering = GETPOST('value', 'int');
  186. $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_LETTERING", $setenablelettering, 'yesno', 0, '', $conf->entity);
  187. if (!($res > 0)) {
  188. $error++;
  189. }
  190. if (!$error) {
  191. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  192. } else {
  193. setEventMessages($langs->trans("Error"), null, 'mesgs');
  194. }
  195. }
  196. if ($action == 'setenableautolettering') {
  197. $setenableautolettering = GETPOST('value', 'int');
  198. $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering, 'yesno', 0, '', $conf->entity);
  199. if (!($res > 0)) {
  200. $error++;
  201. }
  202. if (!$error) {
  203. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  204. } else {
  205. setEventMessages($langs->trans("Error"), null, 'mesgs');
  206. }
  207. }
  208. if ($action == 'setenablevatreversecharge') {
  209. $setenablevatreversecharge = GETPOST('value', 'int');
  210. $res = dolibarr_set_const($db, "ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge, 'yesno', 0, '', $conf->entity);
  211. if (!($res > 0)) {
  212. $error++;
  213. }
  214. if (!$error) {
  215. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  216. } else {
  217. setEventMessages($langs->trans("Error"), null, 'mesgs');
  218. }
  219. }
  220. /*
  221. * View
  222. */
  223. $form = new Form($db);
  224. $title = $langs->trans('ConfigAccountingExpert');
  225. llxHeader('', $title);
  226. $linkback = '';
  227. //$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
  228. print load_fiche_titre($title, $linkback, 'accountancy');
  229. // Show message if accountancy hidden options are activated to help to resolve some problems
  230. if (!$user->admin) {
  231. if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
  232. print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
  233. }
  234. if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
  235. print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
  236. }
  237. if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
  238. print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
  239. }
  240. if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
  241. print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
  242. }
  243. if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
  244. print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
  245. }
  246. }
  247. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  248. print '<input type="hidden" name="token" value="'.newToken().'">';
  249. print '<input type="hidden" name="action" value="update">';
  250. // Params
  251. print '<table class="noborder centpercent">';
  252. print '<tr class="liste_titre">';
  253. print '<td colspan="2">'.$langs->trans('Options').'</td>';
  254. print "</tr>\n";
  255. // TO DO Mutualize code for yes/no constants
  256. /* Set this option as a hidden option but keep it for some needs.
  257. print '<tr>';
  258. print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
  259. if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
  260. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enabledraftexport&value=0">';
  261. print img_picto($langs->trans("Activated"), 'switch_on');
  262. print '</a></td>';
  263. } else {
  264. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enabledraftexport&value=1">';
  265. print img_picto($langs->trans("Disabled"), 'switch_off');
  266. print '</a></td>';
  267. }
  268. print '</tr>';
  269. */
  270. print '<tr class="oddeven">';
  271. print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
  272. if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
  273. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
  274. print img_picto($langs->trans("Activated"), 'switch_on');
  275. print '</a></td>';
  276. } else {
  277. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
  278. print img_picto($langs->trans("Disabled"), 'switch_off');
  279. print '</a></td>';
  280. }
  281. print '</tr>';
  282. print '<tr class="oddeven">';
  283. print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX");
  284. print ' - <span class="opacitymedium">'.$langs->trans("NotRecommended").'</span>';
  285. print '</td>';
  286. if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
  287. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=0">';
  288. print img_picto($langs->trans("Activated"), 'switch_on');
  289. print '</a></td>';
  290. } else {
  291. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=1">';
  292. print img_picto($langs->trans("Disabled"), 'switch_off');
  293. print '</a></td>';
  294. }
  295. print '</tr>';
  296. print '<tr class="oddeven">';
  297. print '<td>'.$langs->trans("ACCOUNTING_MANAGE_ZERO").'</td>';
  298. if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
  299. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=0">';
  300. print img_picto($langs->trans("Activated"), 'switch_on');
  301. print '</a></td>';
  302. } else {
  303. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=1">';
  304. print img_picto($langs->trans("Disabled"), 'switch_off');
  305. print '</a></td>';
  306. }
  307. print '</tr>';
  308. // Param a user $user->rights->accounting->chartofaccount can access
  309. foreach ($list as $key) {
  310. print '<tr class="oddeven value">';
  311. if (getDolGlobalInt('ACCOUNTING_MANAGE_ZERO') && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) {
  312. continue;
  313. }
  314. // Param
  315. $label = $langs->trans($key);
  316. print '<td>'.$label.'</td>';
  317. // Value
  318. print '<td class="right">';
  319. print '<input type="text" class="maxwidth50 right" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
  320. print '</td>';
  321. print '</tr>';
  322. }
  323. print '</table>';
  324. print '<br>';
  325. // Binding params
  326. print '<table class="noborder centpercent">';
  327. print '<tr class="liste_titre">';
  328. print '<td colspan="2">'.$langs->trans('BindingOptions').'</td>';
  329. print "</tr>\n";
  330. // Param a user $user->rights->accounting->chartofaccount can access
  331. foreach ($list_binding as $key) {
  332. print '<tr class="oddeven value">';
  333. // Param
  334. $label = $langs->trans($key);
  335. print '<td>'.$label.'</td>';
  336. // Value
  337. print '<td class="right">';
  338. if ($key == 'ACCOUNTING_DATE_START_BINDING') {
  339. print $form->selectDate((getDolGlobalInt($key) ? (int) getDolGlobalInt($key) : -1), $key, 0, 0, 1);
  340. } elseif ($key == 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
  341. $array = array(0=>$langs->trans("PreviousMonth"), 1=>$langs->trans("CurrentMonth"), 2=>$langs->trans("Fiscalyear"));
  342. print $form->selectarray($key, $array, getDolGlobalInt('ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage');
  343. } else {
  344. print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
  345. }
  346. print '</td>';
  347. print '</tr>';
  348. }
  349. print '<tr class="oddeven">';
  350. print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").'</td>';
  351. if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
  352. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=0">';
  353. print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
  354. print '</a></td>';
  355. } else {
  356. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=1">';
  357. print img_picto($langs->trans("Disabled"), 'switch_off');
  358. print '</a></td>';
  359. }
  360. print '</tr>';
  361. print '<tr class="oddeven">';
  362. print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").'</td>';
  363. if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
  364. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=0">';
  365. print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
  366. print '</a></td>';
  367. } else {
  368. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=1">';
  369. print img_picto($langs->trans("Disabled"), 'switch_off');
  370. print '</a></td>';
  371. }
  372. print '</tr>';
  373. print '<tr class="oddeven">';
  374. print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").'</td>';
  375. if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
  376. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=0">';
  377. print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
  378. print '</a></td>';
  379. } else {
  380. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=1">';
  381. print img_picto($langs->trans("Disabled"), 'switch_off');
  382. print '</a></td>';
  383. }
  384. print '</tr>';
  385. print '</table>';
  386. print '<br>';
  387. // Show advanced options
  388. print '<br>';
  389. // Advanced params
  390. print '<table class="noborder centpercent">';
  391. print '<tr class="liste_titre">';
  392. print '<td colspan="2">' . $langs->trans('OptionsAdvanced') . '</td>';
  393. print "</tr>\n";
  394. print '<tr class="oddeven">';
  395. print '<td>';
  396. print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_LETTERING"), $langs->trans("ACCOUNTING_ENABLE_LETTERING_DESC", $langs->transnoentitiesnoconv("NumMvts")).'<br>'.$langs->trans("EnablingThisFeatureIsNotNecessary")).'</td>';
  397. if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
  398. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=0">';
  399. print img_picto($langs->trans("Activated"), 'switch_on');
  400. print '</a></td>';
  401. } else {
  402. print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=1">';
  403. print img_picto($langs->trans("Disabled"), 'switch_off');
  404. print '</a></td>';
  405. }
  406. print '</tr>';
  407. if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
  408. print '<tr class="oddeven">';
  409. print '<td>';
  410. print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) . '</td>';
  411. if (!empty($conf->global->ACCOUNTING_ENABLE_AUTOLETTERING)) {
  412. print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=0">';
  413. print img_picto($langs->trans("Activated"), 'switch_on');
  414. print '</a></td>';
  415. } else {
  416. print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=1">';
  417. print img_picto($langs->trans("Disabled"), 'switch_off');
  418. print '</a></td>';
  419. }
  420. print '</tr>';
  421. }
  422. print '<tr class="oddeven">';
  423. print '<td>';
  424. print $form->textwithpicto($langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities("MenuDefaultAccounts"))).'</td>';
  425. if (!empty($conf->global->ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE)) {
  426. print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=0">';
  427. print img_picto($langs->trans("Activated"), 'switch_on');
  428. print '</a></td>';
  429. } else {
  430. print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=1">';
  431. print img_picto($langs->trans("Disabled"), 'switch_off');
  432. print '</a></td>';
  433. }
  434. print '</tr>';
  435. print '</table>';
  436. print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
  437. print '</form>';
  438. // End of page
  439. llxFooter();
  440. $db->close();