diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 75e54b2a5905ebf27933195d6f532a0d15e04df4..1764a127515b8cf54dc44a08f9c3e0c81b3c182f 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; @@ -115,6 +116,7 @@ $object = new Account($db); $paymentstatic = new Paiement($db); $paymentsupplierstatic = new PaiementFourn($db); $societestatic = new Societe($db); +$userstatic = new User($db); $chargestatic = new ChargeSociales($db); $paymentvatstatic = new TVA($db); $paymentsalstatic = new PaymentSalary($db); @@ -127,8 +129,8 @@ if ($result) { // Variables $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef")); $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef")); - $cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); $accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef")); + $accountancy_account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef")); $tabpay = array (); $tabbq = array (); @@ -175,7 +177,6 @@ if ($result) { { $tabtype[$obj->rowid] = $links[$key]['type']; - if ($links[$key]['type'] == 'payment') { $paymentstatic->id = $links[$key]['url_id']; @@ -194,6 +195,13 @@ if ($result) { $tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30); $tabtp[$obj->rowid][$compta_soc] += $obj->amount; } + else if ($links[$key]['type'] == 'user') + { + $userstatic->id = $links[$key]['url_id']; + $userstatic->name = $links[$key]['label']; + $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30); + // $tabtp[$obj->rowid][$compta_user] += $obj->amount; + } else if ($links[$key]['type'] == 'sc') { $chargestatic->id = $links[$key]['url_id']; @@ -232,8 +240,8 @@ if ($result) { { $paymentvatstatic->id = $links[$key]['url_id']; $paymentvatstatic->ref = $links[$key]['url_id']; - $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2); - $tabtp[$obj->rowid][$cpttva] += $obj->amount; + $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentVat"); + $tabtp[$obj->rowid][$accountancy_account_pay_vat] += $obj->amount; } else if ($links[$key]['type'] == 'payment_salary') { @@ -427,7 +435,6 @@ if ($action == 'export_csv') foreach ( $tabpay as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); - $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -680,6 +687,7 @@ else print "<td>" . $reflabel . "</td>"; print "<td>" . $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE . "</td>"; print "<td>" . $langs->trans('ThirdParty') . "</td>"; + print "<td> </td>"; print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>"; print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>"; print "</tr>"; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index bcbf11cfdb2807ea4aa68f3b883041db3334b090..3f8ecca00d9cbc9d8d620a859dc6b74997d416e2 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -2,7 +2,8 @@ /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> - * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * * 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,24 @@ 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 +116,8 @@ $form=new Form($db); $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; print_fiche_titre($langs->trans('TaxSetup'),$linkback,'title_setup'); -print '<br>'; +dol_fiche_head(); + if (empty($mysoc->tva_assuj)) { print $langs->trans("YourCompanyDoesNotUseVAT").'<br>'; @@ -134,29 +129,28 @@ else // Cas des parametres TAX_MODE_SELL/BUY_SERVICE/PRODUCT print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="settaxmode">'; + print '<input type="hidden" name="action" value="update">'; + print '<tr class="liste_titre">'; - print '<td>'.$langs->trans('OptionVatMode').'</td><td>'.$langs->trans('Description').'</td>'; - print '<td align="right"><input class="button" type="submit" value="'.$langs->trans('Modify').'"></td>'; + print '<td colspan="2">'.$langs->trans('OptionVatMode').'</td><td>'.$langs->trans('Description').'</td>'; print "</tr>\n"; print '<tr '.$bc[false].'><td width="200"><input type="radio" name="tax_mode" value="0"'.($tax_mode != 1 ? ' checked' : '').'> '.$langs->trans('OptionVATDefault').'</td>'; print '<td colspan="2">'.nl2br($langs->trans('OptionVatDefaultDesc')); print "</td></tr>\n"; print '<tr '.$bc[true].'><td width="200"><input type="radio" name="tax_mode" value="1"'.($tax_mode == 1 ? ' checked' : '').'> '.$langs->trans('OptionVATDebitOption').'</td>'; print '<td colspan="2">'.nl2br($langs->trans('OptionVatDebitOptionDesc'))."</td></tr>\n"; - print '</form>'; print "</table>\n"; - print '<br><br>'; + print '<br>'; print_fiche_titre($langs->trans("SummaryOfVatExigibilityUsedByDefault"),'',''); //print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')'; - print '<table class="border" width="100%">'; - print '<tr><td> </td><td>'.$langs->trans("Buy").'</td><td>'.$langs->trans("Sell").'</td></tr>'; + print '<table class="noborder" width="100%">'; + print '<tr class="liste_titre"><td> </td><td>'.$langs->trans("Buy").'</td><td>'.$langs->trans("Sell").'</td></tr>'; // Products - print '<tr><td>'.$langs->trans("Product").'</td>'; + print '<tr '.$bc[false].'><td>'.$langs->trans("Product").'</td>'; print '<td>'; print $langs->trans("OnDelivery"); print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; @@ -167,7 +161,7 @@ else print '</td></tr>'; // Services - print '<tr><td>'.$langs->trans("Services").'</td>'; + print '<tr '.$bc[true].'><td>'.$langs->trans("Services").'</td>'; print '<td>'; if ($tax_mode == 0) { @@ -196,6 +190,42 @@ else print '</table>'; } +print "<br>\n"; + +/* + * Others params + */ +print '<table class="noborder" width="100%">'; +print '<tr class="liste_titre">'; +print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>'; +print "</tr>\n"; + +foreach ($list as $key) +{ + $var=!$var; + + print '<tr '.$bc[$var].' class="value">'; + + // Param + $label = $langs->trans($key); + print '<td><label for="'.$key.'">'.$label.'</label></td>'; + + // Value + print '<td>'; + print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">'; + print '</td></tr>'; +} + +print '</table>'; + +dol_fiche_end(); + +print '<div class="center">'; +print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '" name="button">'; +print '</div>'; + +print '</form>'; + $db->close(); llxFooter(); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 117a54f89c340d0e9e056be4d4a584fc19897f3b..b623c7daa1fec88cb5524f70a77000407fca05ee 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014-2015 Marcos GarcĂa <marcosgdf@gmail.com> - * Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com> + * Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com> * * 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 @@ -1987,8 +1987,8 @@ class SupplierInvoiceLine extends CommonObjectLine /** * Retrieves a supplier invoice line * - * @param int $rowid Line id - * @return int <0 KO; 0 NOT FOUND; 1 OK + * @param int $rowid Line id + * @return int <0 KO; 0 NOT FOUND; 1 OK */ public function fetch($rowid) { @@ -2052,8 +2052,8 @@ class SupplierInvoiceLine extends CommonObjectLine /** * Deletes a line * - * @param bool|int $notrigger - * @return int -1 KO; 1 OK + * @param bool|int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int 0 if KO, 1 if OK */ public function delete($notrigger = 0) { diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 9e801939dccd69ac96566d2e65a4a92ffade7034..7ce82448cb57596bd6113a5181d92570afab9efd 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 diff --git a/htdocs/theme/md_exp/style.css.php b/htdocs/theme/md_exp/style.css.php index 543ae8a4a54623daf0149eedf70ed73622dc5a3c..d1525b05af71aa5e7673675d53cafa321c462d62 100644 --- a/htdocs/theme/md_exp/style.css.php +++ b/htdocs/theme/md_exp/style.css.php @@ -1773,13 +1773,9 @@ table.noborder, table.formdoc, div.noborder { border-collapse: separate !important; border-spacing: 0px; - border-right-width: 1px; - border-right-color: #CCC; - border-right-style: solid; - - border-left-width: 1px; - border-left-color: #CCC; - border-left-style: solid; + border-width: 1px; + border-color: #CCC; + border-style: solid; margin: 0px 0px 2px 0px;