diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 79ea4a60693..2dfd97a5293 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -143,8 +143,7 @@ if ($HTTP_POST_VARS["action"] == 'add') if ( $comm->fetch($HTTP_POST_VARS["commandeid"]) ) { $lines = $comm->fetch_lignes(); - - for ($i = 0 ; $i < sizeof(lines) ; $i++) + for ($i = 0 ; $i < sizeof($lines) ; $i++) { $result = $facture->addline($facid, addslashes($lines[$i]->description), @@ -388,6 +387,7 @@ $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"; @@ -638,16 +638,17 @@ if ($_GET["action"] == 'create') if ($_GET["commandeid"]) { - print_titre("Produits"); - print ''; + print '
'; print ''; print ''; $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.subprice, pt.qty, p.rowid as prodid, pt.remise_percent"; - $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as pt, ".MAIN_DB_PREFIX."product as p WHERE pt.fk_product = p.rowid AND pt.fk_commande = ".$commande->id; + $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as pt, ".MAIN_DB_PREFIX."product as p"; + $sql .= " WHERE pt.fk_product = p.rowid AND pt.fk_commande = ".$commande->id; $sql .= " ORDER BY pt.rowid ASC"; + $result = $db->query($sql); if ($result) { @@ -660,9 +661,9 @@ if ($_GET["action"] == 'create') $var=!$var; print "\n"; print ''; - print ""; + print ''; print ''; - print "\n"; + print ''; $i++; } }
RéfProduitPrixRemiseQté.
[$objp->ref]'.$objp->product.'".price($objp->subprice)."'.price($objp->subprice).''.$objp->remise_percent.' %".$objp->qty."
'.$objp->qty.'