';
print ' | ';
print '';
+print ' ';
print $langs->trans('From') . ': ';
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
-print ' ';
+print ' ';
+print '';
print $langs->trans('to') . ': ';
print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
+print ' ';
print ' | ';
print ' | ';
print '';
+print ' ';
print $langs->trans('From');
print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
-print ' ';
+print ' ';
+print '';
print $langs->trans('to');
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
+print ' ';
print ' | ';
print '';
+print ' ';
print $langs->trans('From');
print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
-print ' ';
+print ' ';
+print '';
print $langs->trans('to');
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
+print ' ';
print ' | ';
print '';
print '';
@@ -414,7 +423,7 @@ print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
-print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "t.code_tiers", "", $param, "", $sortfield, $sortorder);
+print_liste_field_titre($langs->trans("SubledgerAccount"), $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
@@ -440,14 +449,15 @@ foreach ($object->lines as $line ) {
print ' | ' . dol_print_date($line->doc_date, 'day') . ' | ';
print '' . $line->doc_ref . ' | ';
print '' . length_accountg($line->numero_compte) . ' | ';
- print '' . length_accounta($line->code_tiers) . ' | ';
+ print '' . length_accounta($line->subledger_account) . ' | ';
print '' . $line->label_compte . ' | ';
- print '' . price($line->debit) . ' | ';
- print '' . price($line->credit) . ' | ';
+ print '' . ($line->debit ? price($line->debit) : ''). ' | ';
+ print '' . ($line->credit ? price($line->credit) : '') . ' | ';
$accountingjournal = new AccountingJournal($db);
- $accountingjournal->fetch('',$line->code_journal);
- print '' . $accountingjournal->getNomUrl(0,0,0,'',0) . ' | ';
+ $result = $accountingjournal->fetch('',$line->code_journal);
+ $journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0,0,0,'',0) : $line->code_journal);
+ print '' . $journaltoshow . ' | ';
print '';
print '' . img_edit() . ' ';
diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index b9a5526a7ab..7d0ba2280ea 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -75,10 +75,6 @@ if (empty($search_date_end)) $search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_
$object = new BookKeeping($db);
-$formaccounting = new FormAccounting($db);
-$formother = new FormOther($db);
-$form = new Form($db);
-
$options = '';
$filter = array ();
@@ -126,7 +122,7 @@ if (!GETPOST("button_removefilter_x") && !GETPOST("button_removefilter")) // Bot
* Action
*/
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
{
$search_doc_date = '';
$search_accountancy_code = '';
@@ -156,6 +152,10 @@ if ($action == 'delmouvconfirm') {
* View
*/
+$formaccounting = new FormAccounting($db);
+$formother = new FormOther($db);
+$form = new Form($db);
+
$title_page = $langs->trans("Bookkeeping") . ' ' . strtolower($langs->trans("By")) . ' ' . $langs->trans("AccountAccounting");
llxHeader('', $title_page);
@@ -217,7 +217,7 @@ if ( preg_match('/^asc/i', $sortorder) )
else
$sortorder = "desc";
-print '' . "\n";
+print ' ' . "\n";
print ' ';
print ' ';
@@ -257,13 +257,12 @@ print " |
\n";
print '';
-$var = True;
$total_debit = 0;
$total_credit = 0;
$sous_total_debit = 0;
$sous_total_credit = 0;
-$displayed_account_number = null; // Start with undefined to be able to distinguish with empty
+$displayed_account_number = null; // Start with undefined to be able to distinguish with empty
foreach ( $object->lines as $line ) {
@@ -272,10 +271,10 @@ foreach ( $object->lines as $line ) {
$accountg = length_accountg($line->numero_compte);
//if (empty($accountg)) $accountg = '-';
-
+
// Is it a break ?
if ($accountg != $displayed_account_number || ! isset($displayed_account_number)) {
-
+
// Affiche un Sous-Total par compte comptable
if (isset($displayed_account_number)) {
print '