diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index bcbf11cfdb2..3578c0bdddc 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,6 +34,11 @@ if (!$user->admin) accessforbidden(); $action = GETPOST('action','alpha'); +// Other parameters ACCOUNTING_* +$list = array ( + 'ACCOUNTING_VAT_PAY_ACCOUNT' +); + /* * Actions */ @@ -51,9 +57,11 @@ $action = GETPOST('action','alpha'); $tax_mode = empty($conf->global->TAX_MODE)?0:$conf->global->TAX_MODE; -if ($action == 'settaxmode') -{ - $tax_mode = GETPOST('tax_mode','alpha'); +if ($action == 'update') { + $error = 0; + + // Tax mode + $tax_mode = GETPOST('tax_mode','alpha'); $db->begin(); @@ -79,38 +87,26 @@ if ($action == 'settaxmode') $res = dolibarr_set_const($db, 'TAX_MODE_BUY_SERVICE', $value,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - if (! $error) - { + + + // Others options + foreach ($list as $constname) { + $constvalue = GETPOST($constname, 'alpha'); + + if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error++; + } + } + + if (! $error) { $db->commit(); setEventMessage($langs->trans("SetupSaved")); - } - else - { + } else { $db->rollback(); setEventMessage($langs->trans("Error"),'errors'); } - - } -/* - 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'] : '',$conf->entity)); - { - print $db->error(); - } - } - - if ($_GET['action'] == 'delete') - { - if (! dolibarr_del_const($db, $_GET['constname'],$conf->entity)); - { - print $db->error(); - } - } - */ - /* * View @@ -122,7 +118,8 @@ $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans('TaxSetup'),$linkback,'title_setup'); -print '
'; +dol_fiche_head(); + if (empty($mysoc->tva_assuj)) { print $langs->trans("YourCompanyDoesNotUseVAT").'
'; @@ -134,29 +131,28 @@ else // Cas des parametres TAX_MODE_SELL/BUY_SERVICE/PRODUCT print '
'; print ''; - print ''; + print ''; + print ''; - print ''.$langs->trans('OptionVatMode').''.$langs->trans('Description').''; - print ''; + print ''.$langs->trans('OptionVatMode').''.$langs->trans('Description').''; print "\n"; print ' '.$langs->trans('OptionVATDefault').''; print ''.nl2br($langs->trans('OptionVatDefaultDesc')); print "\n"; print ' '.$langs->trans('OptionVATDebitOption').''; print ''.nl2br($langs->trans('OptionVatDebitOptionDesc'))."\n"; - print '
'; print "\n"; - print '

'; + print '
'; print_fiche_titre($langs->trans("SummaryOfVatExigibilityUsedByDefault"),'',''); //print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')'; - print ''; - print ''; + print '
 '.$langs->trans("Buy").''.$langs->trans("Sell").'
'; + print ''; // Products - print ''; + print ''; print ''; // Services - print ''; + print ''; print '
 '.$langs->trans("Buy").''.$langs->trans("Sell").'
'.$langs->trans("Product").'
'.$langs->trans("Product").''; print $langs->trans("OnDelivery"); print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; @@ -167,7 +163,7 @@ else print '
'.$langs->trans("Services").'
'.$langs->trans("Services").''; if ($tax_mode == 0) { @@ -196,6 +192,42 @@ else print '
'; } +print "
\n"; + +/* + * Others params + */ +print ''; +print ''; +print ''; +print "\n"; + +foreach ($list as $key) +{ + $var=!$var; + + print ''; + + // Param + $label = $langs->trans($key); + print ''; + + // Value + print ''; +} + +print '
' . $langs->trans('OtherOptions') . '
'; + print ''; + print '
'; + +dol_fiche_end(); + +print '
'; +print ''; +print '
'; + +print ''; + $db->close(); llxFooter(); diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 9e801939dcc..7ce82448cb5 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -199,7 +199,8 @@ TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, CalculationMode=Calculation mode AccountancyJournal=Accountancy code journal ACCOUNTING_VAT_SOLD_ACCOUNT=Default accountancy code for collecting VAT -ACCOUNTING_VAT_BUY_ACCOUNT=Default accountancy code for paying VAT +ACCOUNTING_VAT_BUY_ACCOUNT=Default accountancy code for recovered VAT +ACCOUNTING_VAT_PAY_ACCOUNT=Default accountancy code for paying VAT ACCOUNTING_ACCOUNT_CUSTOMER=Accountancy code by default for customer thirdparties ACCOUNTING_ACCOUNT_SUPPLIER=Accountancy code by default for supplier thirdparties CloneTax=Clone a social/fiscal tax