diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 1aea3e27c1b6d..36b3ada162b0a 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -7,6 +7,7 @@ * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2012-2014 Marcos GarcĂ­a * Copyright (C) 2011-2015 Alexandre Spangaro + * Copyright (C) 2015 Florian Henry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,6 +68,8 @@ $req_desc=GETPOST("req_desc",'',3); $req_debit=GETPOST("req_debit",'',3); $req_credit=GETPOST("req_credit",'',3); +$req_month = GETPOST('req_month', 'aplha'); +$req_year = GETPOST('req_year', 'int'); $vline=GETPOST("vline"); $page=GETPOST('page','int'); @@ -87,6 +90,8 @@ $req_desc=""; $req_debit=""; $req_credit=""; + $req_month=""; + $req_year=""; } /* @@ -253,6 +258,18 @@ $param.='&paiementtype='.urlencode($paiementtype); $mode_search = 1; } + if ($req_month) + { + $sql_rech.=" AND MONTH(b.datev) IN (".$db->escape($req_month).")"; + $param.='&req_month='.urlencode($req_month); + $mode_search = 1; + } + if ($req_year) + { + $sql_rech.=" AND YEAR(b.datev) = '".$db->escape($req_year)."'"; + $param.='&req_year='.urlencode($req_year); + $mode_search = 1; + } $sql = "SELECT count(*) as total"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; @@ -398,6 +415,8 @@ print ''; print ''; print ''; + print ''; + print ''; $navig ='
'; if ($limitsql > $viewline) $navig.=''.img_previous().''; @@ -489,9 +508,12 @@ print ''; print ''; + $period_filter .= $langs->trans('Month') . ':'; + $period_filter .= $langs->trans('Year') . ':' . $formother->selectyear($req_year ? $req_year : - 1, 'req_year', 1, 20, 5); + print ''; print ' '; - print ' '; + print ''.$period_filter.''; print ''; //$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...) $filtertype='';