diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index 9b505a20a43..8a1655cdefb 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -144,8 +144,12 @@ if ($modecompta == "CREANCES-DETTES")
{
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$calcmode = $langs->trans("CalcModeDebt");
- $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '', '').')';
- if (!empty($conf->accounting->enabled)) $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '', '').')';
+ $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ if (!empty($conf->accounting->enabled)) {
+ $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ }
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$periodlink = ($year_start ? "".img_previous()." ".img_next()."" : "");
$description = $langs->trans("RulesResultDue");
@@ -157,8 +161,12 @@ if ($modecompta == "CREANCES-DETTES")
{
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$calcmode = $langs->trans("CalcModeEngagement");
- $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')';
- if (!empty($conf->accounting->enabled)) $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '', '').')';
+ $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ if (!empty($conf->accounting->enabled)) {
+ $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ }
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$periodlink = ($year_start ? "".img_previous()." ".img_next()."" : "");
$description = $langs->trans("RulesResultInOut");
@@ -168,8 +176,10 @@ if ($modecompta == "CREANCES-DETTES")
{
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$calcmode = $langs->trans("CalcModeBookkeeping");
- $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '', '').')';
- $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')';
+ $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$arraylist = array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
$period .= ' '.$langs->trans("DetailByAccount").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 15ec1526260..e5d0c4f85d3 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -123,8 +123,12 @@ if ($modecompta == 'CREANCES-DETTES')
{
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode = $langs->trans("CalcModeDebt");
- $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '', '').')';
- if (!empty($conf->accounting->enabled)) $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '', '').')';
+ $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ if (!empty($conf->accounting->enabled)) {
+ $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ }
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$periodlink = ($year_start ? "".img_previous()." ".img_next()."" : "");
$description = $langs->trans("RulesAmountWithTaxIncluded");
@@ -136,8 +140,12 @@ if ($modecompta == 'CREANCES-DETTES')
} elseif ($modecompta == "RECETTES-DEPENSES") {
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode = $langs->trans("CalcModeEngagement");
- $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')';
- if (!empty($conf->accounting->enabled)) $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '', '').')';
+ $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ if (!empty($conf->accounting->enabled)) {
+ $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ }
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$periodlink = ($year_start ? "".img_previous()." ".img_next()."" : "");
$description = $langs->trans("RulesAmountWithTaxIncluded");
@@ -148,8 +156,10 @@ if ($modecompta == 'CREANCES-DETTES')
{
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode = $langs->trans("CalcModeBookkeeping");
- $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '', '').')';
- $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')';
+ $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
+ $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
+ $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode);
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$periodlink = ($year_start ? "".img_previous()." ".img_next()."" : "");
$description = $langs->trans("RulesAmountOnInOutBookkeepingRecord");
@@ -818,17 +828,15 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan
if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
{
$predefinedgroupwhere = "(";
- //$predefinedgroupwhere.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))";
- $predefinedgroupwhere .= " (pcg_type = 'EXPENSE')";
+ $predefinedgroupwhere .= " (aa.pcg_type = 'EXPENSE')";
$predefinedgroupwhere .= " OR ";
- //$predefinedgroupwhere.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))";
- $predefinedgroupwhere .= " (pcg_type = 'INCOME')";
+ $predefinedgroupwhere .= " (aa.pcg_type = 'INCOME')";
$predefinedgroupwhere .= ")";
$charofaccountstring = $conf->global->CHARTOFACCOUNTS;
$charofaccountstring = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
- $sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount";
+ $sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, aa.pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa";
$sql .= " WHERE b.entity = ".$conf->entity;
$sql .= " AND aa.entity = ".$conf->entity;
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index 93f91b25449..0be6659f7b4 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -122,7 +122,7 @@ if ($modecompta == "CREANCES-DETTES")
$name = $langs->trans("Turnover");
$calcmode = $langs->trans("CalcModeDebt");
//$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')';
- $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{links1}', '{link2}').')';
+ $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
$calcmode = str_replace('{link1}', '', $calcmode);
$calcmode = str_replace('{link2}', '', $calcmode);
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php
index f98518ae7ee..eeb1c142712 100644
--- a/htdocs/compta/stats/supplier_turnover.php
+++ b/htdocs/compta/stats/supplier_turnover.php
@@ -59,7 +59,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
{
// We define date_start and date_end
$year_end = $year_start + ($nbofyear - 1);
- $month_start = GETPOST("month") ?GETPOST("month") : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
+ $month_start = GETPOST("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
if (!GETPOST('month'))
{
if (!GETPOST("year") && $month_start > $month_current)
@@ -113,8 +113,9 @@ if ($modecompta == "CREANCES-DETTES")
{
$name = $langs->trans("PurchaseTurnover");
$calcmode = $langs->trans("CalcModeDebt");
- //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')';
- $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '', '').')';
+ $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
+ $calcmode = str_replace('{link1}', '', $calcmode);
+ $calcmode = str_replace('{link2}', '', $calcmode);
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$periodlink = ($year_start ? "".img_previous()." ".img_next()."" : "");
$description = $langs->trans("RulesPurchaseTurnoverDue");
@@ -124,8 +125,6 @@ if ($modecompta == "CREANCES-DETTES")
{
$name = $langs->trans("PurchaseTurnoverCollected");
$calcmode = $langs->trans("CalcModeEngagement");
- //$calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')';
- //$calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')';
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$periodlink = ($year_start ? "".img_previous()." ".img_next()."" : "");
$description = $langs->trans("RulesPurchaseTurnoverIn");
@@ -135,8 +134,9 @@ if ($modecompta == "CREANCES-DETTES")
{
$name = $langs->trans("PurchaseTurnover");
$calcmode = $langs->trans("CalcModeBookkeeping");
- $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')';
- //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')';
+ $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '{link1}', '{link2}').')';
+ $calcmode = str_replace('{link1}', '', $calcmode);
+ $calcmode = str_replace('{link2}', '', $calcmode);
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$periodlink = ($year_start ? "".img_previous()." ".img_next()."" : "");
$description = $langs->trans("RulesPurchaseTurnoverTotalPurchaseJournal");