diff --git a/htdocs/accountancy/bookkeeping/listbyyear.php b/htdocs/accountancy/bookkeeping/listbyyear.php index 19f3c97a08f..ea766c16ef9 100644 --- a/htdocs/accountancy/bookkeeping/listbyyear.php +++ b/htdocs/accountancy/bookkeeping/listbyyear.php @@ -29,6 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; // Langs $langs->load("accountancy"); @@ -43,13 +44,30 @@ $search_doc_type=GETPOST('search_doc_type','alpha'); $search_doc_date=dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); $search_doc_ref=GETPOST('search_doc_ref','alpha'); $search_numero_compte=GETPOST('search_numero_compte','alpha'); +$search_numero_compte_start=GETPOST('search_numero_compte_start','alpha'); +if ($search_numero_compte_start==-1) { + $search_numero_compte_start=''; +} +$search_numero_compte_end=GETPOST('search_numero_compte_end','alpha'); +if ($search_numero_compte_end==-1) { + $search_numero_compte_end=''; +} $search_code_tiers=GETPOST('search_code_tiers','alpha'); +$search_code_tiers_start=GETPOST('search_code_tiers_start','alpha'); +if ($search_code_tiers_start==-1) { + $search_code_tiers_start=''; +} +$search_code_tiers_end=GETPOST('search_code_tiers_end','alpha'); +if ($search_code_tiers_end==-1) { + $search_code_tiers_end=''; +} $search_label_compte=GETPOST('search_label_compte','alpha'); $search_sens=GETPOST('search_sens','alpha'); $search_code_journal=GETPOST('search_code_journal','alpha'); $object = new BookKeeping($db); $form = new Form($db); +$formventilation = new FormVentilation($db); // Filter if (empty($search_date_start)) { @@ -103,10 +121,26 @@ if (! empty($search_numero_compte)) { $filter['t.numero_compte'] = $search_numero_compte; $options .= '&search_numero_compte=' . $search_numero_compte; } +if (! empty($search_numero_compte_start)) { + $filter['t.numero_compte>='] = $search_numero_compte_start; + $options .= '&search_numero_compte_start=' . $search_numero_compte_start; +} +if (! empty($search_numero_compte_end)) { + $filter['t.numero_compte<='] = $search_numero_compte_end; + $options .= '&search_numero_compte_end=' . $search_numero_compte_end; +} if (! empty($search_code_tiers)) { $filter['t.code_tiers'] = $search_code_tiers; $options .= '&search_code_tiers=' . $search_code_tiers; } +if (! empty($search_code_tiers_start)) { + $filter['t.code_tiers>='] = $search_code_tiers_start; + $options .= '&search_code_tiers_start=' . $search_code_tiers_start; +} +if (! empty($search_code_tiers_end)) { + $filter['t.code_tiers<='] = $search_code_tiers_end; + $options .= '&search_code_tiers_end=' . $search_code_tiers_end; +} if (! empty($search_label_compte)) { $filter['t.label_compte'] = $search_label_compte; $options .= '&search_label_compte=' . $search_label_compte; @@ -146,9 +180,22 @@ print $form->select_date($search_date_start, 'date_start'); print $langs->trans('DateEnd') . ': '; print $form->select_date($search_date_end, 'date_end'); print ''; +print '
| '; +print ''; +print ' | '; + print ''; print ''; print ' | '; @@ -218,6 +269,7 @@ foreach ( $object->lines as $line ) { print "||
| ' . $line->piece_num . ' | ' . "\n"; print '' . $line->doc_type . ' | ' . "\n"; print '' . dol_print_date($line->doc_date) . ' | '; print '' . $line->doc_ref . ' | ';