diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 75e54b2a590..1764a127515 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 "
" . $reflabel . " | ";
print "" . $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE . " | ";
print "" . $langs->trans('ThirdParty') . " | ";
+ print " | ";
print "" . ($mt < 0 ? price(- $mt) : '') . " | ";
print "" . ($mt >= 0 ? price($mt) : '') . " | ";
print "";
diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php
index bcbf11cfdb2..3f8ecca00d9 100644
--- a/htdocs/admin/taxes.php
+++ b/htdocs/admin/taxes.php
@@ -2,7 +2,8 @@
/* Copyright (C) 2004 Rodolphe Quiedeville
* Copyright (C) 2004-2008 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
- * Copyright (C) 2011-2013 Juanjo Menent
+ * 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,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=''.$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 +129,28 @@ else
// Cas des parametres TAX_MODE_SELL/BUY_SERVICE/PRODUCT
print '';
print "\n";
- print '
';
+ print '
';
print_fiche_titre($langs->trans("SummaryOfVatExigibilityUsedByDefault"),'','');
//print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')';
- print '';
- print '| | '.$langs->trans("Buy").' | '.$langs->trans("Sell").' |
';
+ print '';
+ print '| | '.$langs->trans("Buy").' | '.$langs->trans("Sell").' |
';
// Products
- print '| '.$langs->trans("Product").' | ';
+ print '
| '.$langs->trans("Product").' | ';
print '';
print $langs->trans("OnDelivery");
print ' ('.$langs->trans("SupposedToBeInvoiceDate").')';
@@ -167,7 +161,7 @@ else
print ' |
';
// Services
- print '| '.$langs->trans("Services").' | ';
+ print '
| '.$langs->trans("Services").' | ';
print '';
if ($tax_mode == 0)
{
@@ -196,6 +190,42 @@ else
print ' |
';
}
+print "
\n";
+
+/*
+ * Others params
+ */
+print '';
+
+dol_fiche_end();
+
+print '';
+print '';
+print '
';
+
+print '';
+
$db->close();
llxFooter();
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 117a54f89c3..b623c7daa1f 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
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2014-2015 Marcos GarcĂa
- * Copyright (C) 2015 Bahfir Abbes
+ * Copyright (C) 2015 Bahfir Abbes
*
* 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 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
diff --git a/htdocs/theme/md_exp/style.css.php b/htdocs/theme/md_exp/style.css.php
index 543ae8a4a54..d1525b05af7 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;