diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index d3dc9b4a190..640cf87d496 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -71,7 +71,7 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($sortorder == "") $sortorder = "ASC";
-if ($sortfield == "") $sortfield = "t.rowid";
+if ($sortfield == "") $sortfield = "t.doc_date";
if (empty($search_date_start) && empty($search_date_end)) {
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
@@ -376,8 +376,8 @@ while ($i < min($num, $limit))
print strlen(length_accounta($line->subledger_account)) == 0 ? '
' . $line->label_operation . ' | ' : '' . $line->label_operation . ' (' . length_accounta($line->subledger_account) . ') | ';
- print '' . ($line->debit ? price($line->debit) :''). ' | ';
- print '' . ($line->credit ? price($line->credit) : '') . ' | ';
+ print '' . ($line->debit ? price($line->debit) :''). ' | ';
+ print '' . ($line->credit ? price($line->credit) : '') . ' | ';
$accountingjournal = new AccountingJournal($db);
$result = $accountingjournal->fetch('', $line->code_journal);
@@ -397,24 +397,27 @@ while ($i < min($num, $limit))
$i++;
}
-// Affiche un Sous-Total du dernier compte comptable affiché
+// Show sub-total of last shown account
print '';
print '| '.$langs->trans("SubTotal").': | '.price($sous_total_debit).' | '.price($sous_total_credit).' | ';
-print " | \n";
-print " | \n";
+print '';
+print price($sous_total_debit - $sous_total_credit);
+print ' | ';
+print ' | ';
print '
';
-// Affiche le Total
+// Show total
print '';
print '| '.$langs->trans("Total").': | ';
-print '';
+print ' | ';
print price($total_debit);
print ' | ';
-print '';
+print ' | ';
print price($total_credit);
print ' | ';
-print ' | ';
+print ' | ';
+print ' | ';
print '
';
print "";