diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index 01d280e38dc..44495028ebb 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -105,6 +105,7 @@ if ($action == 'payed') if ($action == 'addligne') { $fac = new Facture($db); + $fac->fetch($facid); $result = $fac->addline($facid, $HTTP_POST_VARS["desc"], $HTTP_POST_VARS["pu"], @@ -115,13 +116,17 @@ if ($action == 'addligne') if ($action == 'updateligne') { $fac = new Facture($db,"",$facid); - $result = $fac->updateline($rowid,$HTTP_POST_VARS["desc"],$HTTP_POST_VARS["price"],$HTTP_POST_VARS["qty"]); + $fac->fetch($facid); + $result = $fac->updateline($rowid, + $HTTP_POST_VARS["desc"], + $HTTP_POST_VARS["price"], + $HTTP_POST_VARS["qty"]); } if ($action == 'deleteline') { $fac = new Facture($db,"",$facid); - $fac->id = $facid; + $fac->fetch($facid); $result = $fac->deleteline($rowid); } @@ -366,6 +371,51 @@ if ($action == 'create') print "\n"; print "\n"; + if (! $propalid) + { + /* + * + * Liste des elements + * + */ + $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 LIMIT 20"; + if ( $db->query($sql) ) + { + $opt = ""; + if ($result) + { + $num = $db->num_rows(); $i = 0; + while ($i < $num) + { + $objp = $db->fetch_object( $i); + $opt .= "\n"; + $i++; + } + } + $db->free(); + } + else + { + print $db->error(); + } + + print_titre("Services/Produits"); + + print ''; + + for ($i = 1 ; $i < 5 ; $i++) + { + print ''; + print ''; + } + + print "\n"; + + print "
Remise :
"; + + } } } else