From 670c74ecd61416329e52a9f041e643c62e750e68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 May 2011 18:16:57 +0000 Subject: [PATCH] New: Add filter on bank account on check deposits --- htdocs/compta/paiement/cheque/fiche.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 90c5c867610..96ae1208948 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -59,6 +59,7 @@ $offset = $limit * $page ; $dir=$conf->banque->dir_output.'/bordereau/'; $filterdate=dol_mktime(0,0,0,$_POST['fdmonth'],$_POST['fdday'],$_POST['fdyear']); +$filteraccountid=GETPOST('accountid'); //var_dump($_POST); /* @@ -222,6 +223,12 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) * View */ +if (GETPOST('removefilter')) +{ + $filterdate=''; + $filteraccountid=0; +} + llxHeader(); $html = new Form($db); @@ -297,11 +304,19 @@ if ($action == 'new') print ''; //print ''; // Filter - print ''; + print ''; print ''; print '
'.$langs->trans('Date').''.dol_print_date($now,'day').'
'.$langs->trans("Date").''; - print $html->select_date($filterdate,'fd',0,0,1); + print '
'.$langs->trans("Date").''; + print $html->select_date($filterdate,'fd',0,0,1,'',1,1); print '
'.$langs->trans("BankAccount").''; + print $html->select_comptes($filteraccountid,'accountid',0,0,1); + print '
'; print ''; + if ($filterdate || $filteraccountid > 0) + { + print '   '; + print ''; + } print '
'; //print ''; @@ -317,7 +332,8 @@ if ($action == 'new') $sql.= " AND ba.entity = ".$conf->entity; $sql.= " AND b.fk_bordereau = 0"; $sql.= " AND b.amount > 0"; - if ($filterdate) $sql.=" AND b.dateo = '".$db->idate($filterdate)."'"; + if ($filterdate) $sql.=" AND b.dateo = '".$db->idate($filterdate)."'"; + if ($filteraccountid) $sql.=" AND ba.rowid= '".$filteraccountid."'"; $sql.= $db->order("b.dateo,b.rowid","ASC"); $resql = $db->query($sql);