From a3647bea4eaf2c67ae22c291edde71e4318fc02a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Sep 2015 11:53:36 +0200 Subject: [PATCH] Fix bad information in report --- htdocs/compta/tva/clients.php | 40 +++++++++++++++++++++++++++++++---- htdocs/core/lib/tax.lib.php | 2 +- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 0625dd4978d..9a7166b7892 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -100,6 +100,10 @@ if ($user->societe_id) { } $result = restrictedArea($user, 'tax', '', '', 'charges'); +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') +$modecompta = $conf->global->ACCOUNTING_MODE; +if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta"); + /* @@ -292,7 +296,14 @@ if (is_array($coll_list)) { } else { $langs->load("errors"); if ($coll_list == -1) { - print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + if ($modecompta == 'CREANCES-DETTES') + { + print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + } + else + { + print '' . $langs->trans("FeatureNotYetAvailable") . ''; + } } else if ($coll_list == -2) { print '' . $langs->trans("FeatureNotYetAvailable") . ''; } else { @@ -377,7 +388,14 @@ if (is_array($coll_list)) { } else { $langs->load("errors"); if ($coll_list == -1) { - print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + if ($modecompta == 'CREANCES-DETTES') + { + print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + } + else + { + print '' . $langs->trans("FeatureNotYetAvailable") . ''; + } } else if ($coll_list == -2) { print '' . $langs->trans("FeatureNotYetAvailable") . ''; } else { @@ -457,7 +475,14 @@ if ($special_report) { } else { $langs->load("errors"); if ($coll_list == -1) { - print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + if ($modecompta == 'CREANCES-DETTES') + { + print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + } + else + { + print '' . $langs->trans("FeatureNotYetAvailable") . ''; + } } else { if ($coll_list == -2) { print '' . $langs->trans("FeatureNotYetAvailable") . ''; @@ -530,7 +555,14 @@ if ($special_report) { } else { $langs->load("errors"); if ($coll_list == -1) { - print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + if ($modecompta == 'CREANCES-DETTES') + { + print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ''; + } + else + { + print '' . $langs->trans("FeatureNotYetAvailable") . ''; + } } else { if ($coll_list == -2) { print '' . $langs->trans("FeatureNotYetAvailable") . ''; diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index b2b99d34d3b..2387332e670 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -79,7 +79,7 @@ function tax_prepare_head(ChargeSociales $object) * @param int $y Year * @param string $date_start Start date * @param string $date_end End date - * @param int $modetax 0 or 1 (option vat on debit) + * @param int $modetax 0 or 1 (option vat on debit, 1 => $modecompta = 'CREANCES-DETTES') * @param string $direction 'sell' or 'buy' * @param int $m Month * @return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error