';
+
+// Code journal
+if (!empty($arrayfields['t.code_journal']['checked'])) {
+ print ' | ';
+}
+// Date document
+if (!empty($arrayfields['t.doc_date']['checked'])) {
+ print '';
+ print ' ';
+ print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
+ print ' ';
+ print '';
+ print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
+ print ' ';
+ print ' | ';
+}
+// Movement number
+if (!empty($arrayfields['t.piece_num']['checked']))
+{
+ print ' | ';
+}
+// Ref document
+if (!empty($arrayfields['t.doc_ref']['checked'])) {
+ print ' | ';
+}
+// Label operation
+if (!empty($arrayfields['t.label_operation']['checked'])) {
+ print ' | ';
+}
+// Debit
+if (!empty($arrayfields['t.debit']['checked'])) {
+ print ' | ';
+}
+// Credit
+if (!empty($arrayfields['t.credit']['checked'])) {
+ print ' | ';
+}
+// Lettering code
+if (!empty($arrayfields['t.lettering_code']['checked']))
+{
+ print '';
+ print '';
+ print ' '.$langs->trans("NotReconciled").'';
+ print ' | ';
+}
+
+// Fields from hook
+$parameters = array('arrayfields'=>$arrayfields);
+$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+
+// Action column
+print '';
+$searchpicto = $form->showFilterButtons();
+print $searchpicto;
+print ' | ';
+print "
\n";
+
+print '';
+
+ // Journal code
+ if (!empty($arrayfields['t.code_journal']['checked']))
+ {
+ $accountingjournal = new AccountingJournal($db);
+ $result = $accountingjournal->fetch('', $line->code_journal);
+ $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal);
+ print '| '.$journaltoshow.' | ';
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Document date
+ if (!empty($arrayfields['t.doc_date']['checked']))
+ {
+ print ''.dol_print_date($line->doc_date, 'day').' | ';
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Piece number
+ if (!empty($arrayfields['t.piece_num']['checked']))
+ {
+ print '';
+ $object->id = $line->id;
+ $object->piece_num = $line->piece_num;
+ print $object->getNomUrl(1, '', 0, '', 1);
+ print ' | ';
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Document ref
+ if (!empty($arrayfields['t.doc_ref']['checked']))
+ {
+ if ($line->doc_type == 'customer_invoice')
+ {
+ $langs->loadLangs(array('bills'));
+
+ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
+ $objectstatic = new Facture($db);
+ $objectstatic->fetch($line->fk_doc);
+ //$modulepart = 'facture';
+
+ $filename = dol_sanitizeFileName($line->doc_ref);
+ $filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
+ $urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
+ $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
+ } elseif ($line->doc_type == 'supplier_invoice')
+ {
+ $langs->loadLangs(array('bills'));
+
+ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
+ $objectstatic = new FactureFournisseur($db);
+ $objectstatic->fetch($line->fk_doc);
+ //$modulepart = 'invoice_supplier';
+
+ $filename = dol_sanitizeFileName($line->doc_ref);
+ $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
+ $subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
+ $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
+ } elseif ($line->doc_type == 'expense_report')
+ {
+ $langs->loadLangs(array('trips'));
+
+ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
+ $objectstatic = new ExpenseReport($db);
+ $objectstatic->fetch($line->fk_doc);
+ //$modulepart = 'expensereport';
+
+ $filename = dol_sanitizeFileName($line->doc_ref);
+ $filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
+ $urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
+ $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
+ } else {
+ // Other type
+ }
+
+ print '';
+
+ print '';
+ // Picto + Ref
+ print '| ';
+
+ if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report')
+ {
+ print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
+ print $documentlink;
+ } else {
+ print $line->doc_ref;
+ }
+ print ' | ';
+
+ print " | \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Label operation
+ if (!empty($arrayfields['t.label_operation']['checked'])) {
+ // Affiche un lien vers la facture client/fournisseur
+ $doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
+ print strlen(length_accounta($line->subledger_account)) == 0 ? '' . $line->label_operation . ' | ' : '' . $line->label_operation . ' (' . length_accounta($line->subledger_account) . ') | ';
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Amount debit
+ if (!empty($arrayfields['t.debit']['checked']))
+ {
+ print ''.($line->debit ? price($line->debit) : '').' | ';
+ if (!$i) $totalarray['nbfield']++;
+ if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit';
+ $totalarray['val']['totaldebit'] += $line->debit;
+ }
+
+ // Amount credit
+ if (!empty($arrayfields['t.credit']['checked'])) {
+ print '' . ($line->credit ? price($line->credit) : '') . ' | ';
+ if (!$i) $totalarray['nbfield']++;
+ if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit';
+ $totalarray['val']['totalcredit'] += $line->credit;
+ }
+
+ // Lettering code
+ if (!empty($arrayfields['t.lettering_code']['checked']))
+ {
+ print ''.$line->lettering_code.' | ';
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Fields from hook
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+
+ // Action column
+ print '';
+ if (empty($line->date_export)) {
+ if ($user->rights->accounting->mouvements->creer) {
+ print ''.img_edit().'';
+ }
+ if ($user->rights->accounting->mouvements->supprimer) {
+ print ' '.img_delete().'';
+ }
+ }
+ print ' | ';
+ if (!$i) $totalarray['nbfield']++;
+
+ // Comptabilise le sous-total
+ $sous_total_debit += $line->debit;
+ $sous_total_credit += $line->credit;
+
+ print "
\n";
+
+ $i++;
+}
+
+// Show sub-total of last shown account
+$colspan = $totalarray['nbfield'] - 3;
+$colspanend = $totalarray['nbfield'] - 8;
+print '