This commit is contained in:
Regis Houssin
2019-12-12 16:35:07 +01:00
parent c72e7e6a97
commit a527e72124
2 changed files with 4 additions and 1 deletions

View File

@@ -815,7 +815,9 @@ if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
$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.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa";
$sql.= " WHERE b.numero_compte = aa.account_number AND b.entity = ".$conf->entity;
$sql.= " WHERE b.entity = ".$conf->entity;
$sql.= " AND aa.entity = ".$conf->entity;
$sql.= " AND b.numero_compte = aa.account_number";
$sql.= " AND ".$predefinedgroupwhere;
$sql.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'";
if (! empty($date_start) && ! empty($date_end))

View File

@@ -194,6 +194,7 @@ elseif ($modecompta=="BOOKKEEPING")
$sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj";
$sql.= " WHERE b.entity = ".$conf->entity;
$sql.= " AND aj.entity = ".$conf->entity;
$sql.= " AND b.code_journal = aj.code AND aj.nature = 2" ; // @TODO currently count amount in sale journal, but we need to define a category group for turnover
}