This commit is contained in:
Laurent Destailleur 2008-11-04 17:26:33 +00:00
parent a72be2810d
commit e68b6de735
4 changed files with 25 additions and 18 deletions

View File

@ -18,11 +18,11 @@
*/ */
/** /**
\file htdocs/admin/compta.php \file htdocs/admin/compta.php
\ingroup tax \ingroup tax
\brief Page de configuration du module tax \brief Page de configuration du module tax
\version $Id$ \version $Id$
*/ */
require('./pre.inc.php'); require('./pre.inc.php');
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
@ -31,7 +31,7 @@ $langs->load('admin');
$langs->load('compta'); $langs->load('compta');
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
llxHeader(); llxHeader();
@ -41,8 +41,10 @@ $compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES';
if ($_POST['action'] == 'setcomptamode') if ($_POST['action'] == 'setcomptamode')
{ {
$compta_mode = $_POST['compta_mode']; $compta_mode = $_POST['compta_mode'];
if (! dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode)) { print $db->error(); } if (! dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode)) { print $db->error(); }
// Note: This setup differs from TAX_MODE.
// TAX_MODE is used with 0=normal, 1=option vat for services is on debit
} }
@ -54,7 +56,7 @@ if ($_POST['action'] == 'update' || $_POST['action'] == 'add')
{ {
if (! dolibarr_set_const($db, $_POST['constname'], $_POST['constvalue'], $typeconst[$_POST['consttype']], 0, isset($_POST['constnote']) ? $_POST['constnote'] : '')); if (! dolibarr_set_const($db, $_POST['constname'], $_POST['constvalue'], $typeconst[$_POST['consttype']], 0, isset($_POST['constnote']) ? $_POST['constnote'] : ''));
{ {
print $db->error(); print $db->error();
} }
} }
@ -63,7 +65,7 @@ if ($_GET['action'] == 'delete')
{ {
if (! dolibarr_del_const($db, $_GET['constname'])); if (! dolibarr_del_const($db, $_GET['constname']));
{ {
print $db->error(); print $db->error();
} }
} }
@ -93,13 +95,13 @@ print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// Write info on way to count VAT // Write info on way to count VAT
if ($conf->global->MAIN_MODULE_COMPTABILITE) if ($conf->global->MAIN_MODULE_COMPTABILITE)
{ {
// print "<br>\n"; // print "<br>\n";
// print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));
} }
else else
{ {
// print "<br>\n"; // print "<br>\n";
// print nl2br($langs->trans('OptionModeTrueInfoExpert')); // print nl2br($langs->trans('OptionModeTrueInfoExpert'));
} }
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr '.$bc[true].'><td width="200"><input type="radio" name="compta_mode" value="CREANCES-DETTES"'.($compta_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>'; print '<tr '.$bc[true].'><td width="200"><input type="radio" name="compta_mode" value="CREANCES-DETTES"'.($compta_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>';

View File

@ -34,6 +34,9 @@ $langs->load('taxes');
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
/*
* View
*/
llxHeader(); llxHeader();

View File

@ -54,6 +54,7 @@ if($min == 0 or $min!=floatval(strval($min))){
} }
// Define modetax (0 or 1) // Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit
$modetax = $conf->global->TAX_MODE; $modetax = $conf->global->TAX_MODE;
if ($_GET["modetax"]) $modetax=$_GET["modetax"]; if ($_GET["modetax"]) $modetax=$_GET["modetax"];

View File

@ -54,6 +54,7 @@ if (empty($year))
$q=(! empty($_GET["q"]))?$_GET["q"]:1; $q=(! empty($_GET["q"]))?$_GET["q"]:1;
// Define modetax (0 or 1) // Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit
$modetax = $conf->global->TAX_MODE; $modetax = $conf->global->TAX_MODE;
if ($_GET["modetax"]) $modetax=$_GET["modetax"]; if ($_GET["modetax"]) $modetax=$_GET["modetax"];