From 307ffd8dddd70234840e278aa25018078f51861c Mon Sep 17 00:00:00 2001 From: erics Date: Thu, 8 Jan 2004 22:58:10 +0000 Subject: [PATCH] =?UTF-8?q?correction=20de=20deux=20bugs,=20if()=20remplac?= =?UTF-8?q?ait=20un=20if(->query)=20ce=20qui=20fait=20que=20la=20facture?= =?UTF-8?q?=20n'=E9tait=20jamais=20cr=E9=E9e=20et=20un=20LIMIT=2020=20enle?= =?UTF-8?q?v=E9=20puisqu'on=20a=20juste=20apr=E8s=20un=20->plimit=20qui=20?= =?UTF-8?q?cr=E9=E9=20le=20LIMIT=20lui=20m=EAme=20(on=20avait=20donc=20une?= =?UTF-8?q?=20requete=20avec=20LIMIT=2020=20LIMIT=20xx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8598bfadc19..243b29097b3 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -46,7 +46,8 @@ if ($user->societe_id > 0) } /* * - */ + */ + if ($HTTP_POST_VARS["action"] == 'classin') { $facture = new Facture($db); @@ -374,7 +375,6 @@ $html = new Form($db); if ($_GET["action"] == 'create') { print_titre("Emettre une facture"); - if ($propalid) { $sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.remise_percent, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst"; @@ -397,7 +397,7 @@ if ($_GET["action"] == 'create') } - if ( $societe_id ) + if ( $db->query($sql) ) { $num = $db->num_rows(); if ($num) @@ -488,7 +488,7 @@ if ($_GET["action"] == 'create') */ $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM llx_product as p "; $sql .= " WHERE envente = 1"; - $sql .= " ORDER BY p.nbvente DESC"; + $sql .= " ORDER BY p.nbvente DESC LIMIT 20"; if ( $db->query($sql) ) { $opt = ""; @@ -1294,7 +1294,7 @@ else } - $sql .= " ORDER BY $sortfield $sortorder, rowid DESC LIMIT 20"; + $sql .= " ORDER BY $sortfield $sortorder, rowid DESC"; $sql .= $db->plimit($limit + 1,$offset); $result = $db->query($sql);