Fix report

This commit is contained in:
Laurent Destailleur 2021-03-31 21:25:01 +02:00
parent 2af8b7078c
commit 0fd36d96f3
3 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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";

View File

@ -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. <br>- It is based on the billing date of these invoices.<br>
RulesCAIn=- It includes all the effective payments of invoices received from customers.<br>- It is based on the payment date of these invoices<br>
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 <b>grouped by personalized groups</b>
@ -281,7 +281,7 @@ PurchaseTurnoverCollected=Purchase turnover collected
RulesPurchaseTurnoverDue=- It includes the supplier's due invoices whether they are paid or not. <br>- It is based on the invoice date of these invoices.<br>
RulesPurchaseTurnoverIn=- It includes all the effective payments of invoices done to suppliers.<br>- It is based on the payment date of these invoices<br>
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