diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 7b52c5b3cbd..7854f6656ed 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -254,9 +254,33 @@ else if ($modecompta=="RECETTES-DEPENSES") else if ($modecompta=="BOOKKEEPING") { - //All categories - $cats = $AccCat->getCats(); - if ($catsCalcule < 0) dol_print_error($db, $AccCat->error, $AccCat->errors); + // Get array of all report groups that are active + $cats = $AccCat->getCats(); // WARNING: Computed groups must be after group they include + + /* + $sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa'; + $sql.= " WHERE t.numero_compte = aa.account_number AND aa.fk_accounting_category = 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.doc_date >= '".$db->idate($date_start)."' AND t.doc_date <= '".$db->idate($date_end)."'"; + if (! empty($month)) { + $sql .= " AND MONTH(t.doc_date) = " . $month; + } + $resql = $db->query($sql); + if ($resql) + { + $num_rows = $db->num_rows($resql); + if ($num_rows) { + + print '