diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php
index cd2fc1b998b..f41c9c4072e 100644
--- a/htdocs/compta/charges/index.php
+++ b/htdocs/compta/charges/index.php
@@ -162,7 +162,7 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
{
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
- $sql.= " AND f.datev between '".$db->idate(dol_get_first_day($year,1))."' AND '".$db->idate(dol_get_last_day($year,12))."'";
+ $sql.= " AND f.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
$sql.= " ORDER BY dm DESC";
diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php
index 95bca286309..ca7b890e2fc 100644
--- a/htdocs/compta/tva/index.php
+++ b/htdocs/compta/tva/index.php
@@ -109,6 +109,9 @@ $textnextyear=" ".img_next(
print_fiche_titre($langs->trans("VAT"),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear");
+print $langs->trans("VATReportBuildWithOptionDefinedInModule").'
';
+print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')
';
+print '
';
echo '
';
echo '| ';
@@ -211,9 +214,8 @@ print ' |
';
echo ' | ';
-
/*
-* Reglee
+* Payed
*/
$sql = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm";
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index 23c3cda0475..0310998d20d 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -11,6 +11,7 @@ OptionModeVirtual=Option Credits-Debits
OptionModeTrueDesc=In this context, the turnover is calculated over payments (date of payments). \nThe validity of the figures is assured only if the book-keeping is scrutinized through the input/output on the accounts via invoices.
OptionModeVirtualDesc=In this context, the turnover is calculated over invoices (date of validation). When these invoices are due, whether they have been paid or not, they are listed in the turnover output.
FeatureIsSupportedInInOutModeOnly=Feature only available in CREDITS-DEBTS accountancy mode (See Accountancy module configuration)
+VATReportBuildWithOptionDefinedInModule=Amounts shown here are calculated using rules defined by Tax module setup.
Param=Setup
AccountsGeneral=Accounts
Account=Account
diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang
index 3d18248c895..6fce73b7ae6 100644
--- a/htdocs/langs/fr_FR/compta.lang
+++ b/htdocs/langs/fr_FR/compta.lang
@@ -11,6 +11,7 @@ OptionModeVirtual=Option Créances-Dettes
OptionModeTrueDesc=Dans ce mode, le CA est calculé sur la base des paiements (date de réglement).\nLa validité des chiffres n'est donc assurée que si la tenue de la comptabilité passe rigoureusement par des entrées/sorties sur les comptes via des factures.
OptionModeVirtualDesc=Dans ce mode, le CA est calculé sur la base des factures (date de validation). Payées ou non, elles apparaissent dans le résultat dès qu'elles sont dues.
FeatureIsSupportedInInOutModeOnly=Fonction disponible uniquement en mode compta CREANCES-DETTES (Voir configuration du module compta)
+VATReportBuildWithOptionDefinedInModule=Les montants obtenus sont ceux calculées à partir des règles de calcul paramétrées pour le module Taxes.
Param=Paramétrage
AccountsGeneral=Comptes généraux
Account=Compte
diff --git a/htdocs/lib/date.lib.php b/htdocs/lib/date.lib.php
index 31780d8ac46..dcd8ec8d7fc 100644
--- a/htdocs/lib/date.lib.php
+++ b/htdocs/lib/date.lib.php
@@ -128,9 +128,12 @@ function dol_get_next_month($month, $year)
/** \brief Return GMT time for first day of a month or year
* \param year Year
* \param month Month
- * \return Timestamp Date for first day
+ * \param gm False = Return date to compare with server TZ, True to compare with GM date.
+ * Exemple: dol_get_first_day(1970,1,false) will return -3600 with TZ+1, after dol_print_date will return 1970-01-01 00:00:00
+ * Exemple: dol_get_first_day(1970,1,true) will return 0 whatever is TZ, after dol_print_date will return 1970-01-01 00:00:00
+ * \return Timestamp Date for first day
*/
-function dol_get_first_day($year,$month=1,$gm=true)
+function dol_get_first_day($year,$month=1,$gm=false)
{
return dol_mktime(0,0,0,$month,1,$year,$gm);
}
@@ -139,9 +142,10 @@ function dol_get_first_day($year,$month=1,$gm=true)
/** \brief Return GMT time for last day of a month or year
* \param year Year
* \param month Month
+ * \param gm False = Return date to compare with server TZ, True to compare with GM date.
* \return Timestamp Date for first day
*/
-function dol_get_last_day($year,$month=12,$gm=true)
+function dol_get_last_day($year,$month=12,$gm=false)
{
if ($month == 12)
{
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index 5a08186bc61..abc6f3532d5 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -101,13 +101,13 @@ if ($conf->categorie->enabled && !$user->rights->categorie->voir)
if ($month > 0)
{
if ($year > 0)
- $sql.= " AND m.datem between '".$db->idate(dol_get_first_day($year,$month))."' AND '".$db->idate(dol_get_last_day($year,$month))."'";
+ $sql.= " AND m.datem between '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
else
$sql.= " AND date_format(m.datem, '%m') = '$month'";
}
else if ($year > 0)
{
- $sql.= " AND m.datem between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."'";
+ $sql.= " AND m.datem between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
if (! empty($search_movment))
{
|