From 82e3f2c5163708a73f35d3a3d55c9d1c8eb4d8df Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 17 Dec 2004 15:57:19 +0000 Subject: [PATCH] =?UTF-8?q?Mise=20=E0=20jour=20formulaire=20de=20recherche?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture.php | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d71d59b4270..8d2d894dc62 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1503,7 +1503,10 @@ else $sortfield="f.datef"; $sql = "SELECT s.nom,s.idp,f.facnumber,f.total,f.total_ttc,".$db->pdate("f.datef")." as df, f.paye as paye, f.rowid as facid, f.fk_statut, sum(pf.amount) as am"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f left join ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture WHERE f.fk_soc = s.idp"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql .= ",".MAIN_DB_PREFIX."facture as f"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid=pf.fk_facture "; + $sql .= " WHERE f.fk_soc = s.idp"; if ($socidp) $sql .= " AND s.idp = $socidp"; @@ -1521,6 +1524,16 @@ else } } + if ($_GET["search_ref"]) + { + $sql .= " AND f.facnumber like '%".$_GET["search_ref"]."%'"; + } + + if ($_GET["search_societe"]) + { + $sql .= " AND s.nom like '%".$_GET["search_societe"]."%'"; + } + if ($year > 0) $sql .= " AND date_format(f.datef, '%Y') = $year"; @@ -1568,18 +1581,16 @@ else print "\n"; // Lignes des champs de filtre - print '
'; + print ''; print ''; print ''; - print ''; + print ''; print ' '; print ''; - print ''; - print ''; - print ''; + print ''; + print ' '; print ' '; print ''; - print '  '; print ''; print "\n"; print '
';