diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index 58d4458ca6a..f1e5c241ab0 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -233,7 +233,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$pcgvercode = $pcgverid;
}
- $sql = "SELECT date_format(b.doc_date, '%Y-%m') as dm, sum(b.debit) as amount_ttc";
+ $sql = "SELECT date_format(b.doc_date, '%Y-%m') as dm, sum(b.credit - b.debit) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b,";
$sql .= " ".MAIN_DB_PREFIX."accounting_account as aa";
$sql .= " WHERE b.entity = ".$conf->entity; // In module double party accounting, we never share entities
@@ -246,6 +246,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql .= " GROUP BY dm";
$sql .= " ORDER BY dm";
// TODO Add a filter on $date_start and $date_end to reduce quantity on data
+//print $sql;
$minyearmonth = $maxyearmonth = 0;
diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php
index dc8417e58a1..6beba492fb5 100644
--- a/htdocs/compta/stats/supplier_turnover.php
+++ b/htdocs/compta/stats/supplier_turnover.php
@@ -199,7 +199,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$pcgvercode = $pcgverid;
}
- $sql = "SELECT date_format(b.doc_date, '%Y-%m') as dm, sum(b.debit) as amount_ttc";
+ $sql = "SELECT date_format(b.doc_date, '%Y-%m') as dm, sum(b.debit - b.credit) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b,";
$sql .= " ".MAIN_DB_PREFIX."accounting_account as aa";
$sql .= " WHERE b.entity = ".$conf->entity; // In module double party accounting, we never share entities
@@ -209,6 +209,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql .= " AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
$sql .= " AND aa.pcg_type = 'EXPENSE'"; // TODO Be able to use a custom group
}
+//print $sql;
$sql .= " GROUP BY dm";
$sql .= " ORDER BY dm";
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index befb6adf75b..7080810bfea 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -175,7 +175,7 @@ RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT
RulesCADue=- It includes the customer's due invoices whether they are paid or not.
- It is based on the billing date of these invoices.
RulesCAIn=- It includes all the effective payments of invoices received from customers.
- It is based on the payment date of these invoices
RulesCATotalSaleJournal=It includes all credit lines from the Sale journal.
-RulesSalesTurnoverOfIncomeAccounts=It includes all debit of product accounts in group INCOME
+RulesSalesTurnoverOfIncomeAccounts=It includes (credit - debit) of lines for product accounts in group INCOME
RulesAmountOnInOutBookkeepingRecord=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME"
RulesResultBookkeepingPredefined=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME"
RulesResultBookkeepingPersonalized=It show record in your Ledger with accounting accounts grouped by personalized groups
@@ -281,7 +281,7 @@ PurchaseTurnoverCollected=Purchase turnover collected
RulesPurchaseTurnoverDue=- It includes the supplier's due invoices whether they are paid or not.
- It is based on the invoice date of these invoices.
RulesPurchaseTurnoverIn=- It includes all the effective payments of invoices done to suppliers.
- It is based on the payment date of these invoices
RulesPurchaseTurnoverTotalPurchaseJournal=It includes all debit lines from the purchase journal.
-RulesPurchaseTurnoverOfExpenseAccounts=It includes all debit of product accounts in group EXPENSE
+RulesPurchaseTurnoverOfExpenseAccounts=It includes (debit - credit) of lines for product accounts in group EXPENSE
ReportPurchaseTurnover=Purchase turnover invoiced
ReportPurchaseTurnoverCollected=Purchase turnover collected
IncludeVarpaysInResults = Include various payments in reports