From fea3182e931a25de4bab8a9fc05204dfd842ee5b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Apr 2018 00:01:54 +0200 Subject: [PATCH] NEW Can filter on account range in general ledger grouped by account --- .../accountancy/bookkeeping/listbyaccount.php | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 04708fe7726..dbc6ace5350 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -51,6 +51,10 @@ $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha if ($search_accountancy_code_start == - 1) { $search_accountancy_code_start = ''; } +$search_accountancy_code_end = GETPOST('search_accountancy_code_end', 'alpha'); +if ($search_accountancy_code_end == - 1) { + $search_accountancy_code_end = ''; +} $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); $search_label_operation = GETPOST('search_label_operation', 'alpha'); $search_direction = GETPOST('search_direction', 'alpha'); @@ -116,9 +120,13 @@ if (! empty($search_doc_date)) { if (! GETPOST('button_removefilter_x','alpha') && ! GETPOST('button_removefilter.x','alpha') && ! GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { if (! empty($search_accountancy_code_start)) { - $filter['t.numero_compte'] = $search_accountancy_code_start; + $filter['t.numero_compte>='] = $search_accountancy_code_start; $options .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); } + if (! empty($search_accountancy_code_end)) { + $filter['t.numero_compte<='] = $search_accountancy_code_end; + $options .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); + } if (! empty($search_label_account)) { $filter['t.label_compte'] = $search_label_account; $options .= '&search_label_compte=' . urlencode($search_label_account); @@ -151,7 +159,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_doc_date = ''; $search_accountancy_code = ''; $search_accountancy_code_start = ''; - $search_label_account = ''; + $search_accountancy_code_end = ''; + $search_label_account = ''; $search_doc_ref = ''; $search_label_operation = ''; $search_direction = ''; @@ -260,7 +269,16 @@ else print ''; print ''; -print ''; +print ''; print ''; print '
' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . ''; +print '
'; +print $langs->trans('From').' '; +print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, 'maxwidth200'); +print '
'; +print '
'; +print $langs->trans('to').' '; +print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, 'maxwidth200'); +print '
'; +print '
'; print $langs->trans('From') . ': ';