diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php index 49aafe5ec0c..1385d4986db 100644 --- a/htdocs/compta/ventilation/lignes.php +++ b/htdocs/compta/ventilation/lignes.php @@ -1,7 +1,5 @@ - * Copyright (C) 2004 Éric Seigne - * Copyright (C) 2004 Laurent Destailleur * * 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 @@ -22,11 +20,8 @@ * */ - - require("./pre.inc.php"); - if ($_GET["socidp"]) { $socidp=$_GET["socidp"]; } /* * Sécurité accés client @@ -53,12 +48,21 @@ $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; $sql .= " , ".MAIN_DB_PREFIX."facture as f"; $sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c"; -$sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 AND c.rowid = l.fk_code_ventilation"; +$sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 "; +$sql .= " AND c.rowid = l.fk_code_ventilation"; + +if (strlen(trim($_GET["search_facture"]))) +{ + $sql .= " AND f.facnumber like '%".$_GET["search_facture"]."%'"; +} + $sql .= " ORDER BY l.rowid DESC"; $sql .= $db->plimit($limit+1,$offset); - $result = $db->query($sql); + + + if ($result) { $num_lignes = $db->num_rows(); @@ -66,14 +70,19 @@ if ($result) print_barre_liste("Lignes de facture ventilées",$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes); - if ($num_lignes) - { - echo ''; - print ""; - print ''; - print ''; - print "\n"; - } + print ''; + print '
Facture'.$langs->trans("Description").''.$langs->trans("Compte").'
'; + print ""; + print ''; + print ''; + print "\n"; + + print ''; + print ''; + print ''; + print ''; + print "\n"; + $var=True; while ($i < min($num_lignes, $limit)) { @@ -96,12 +105,15 @@ if ($result) print ""; $i++; } - print "
Facture'.$langs->trans("Description").''.$langs->trans("Compte").'
'.$langs->trans("Description").''.$langs->trans("Compte").'
"; + } else { print $db->error(); } + +print ""; + $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$");