From 9e758ab26826eed4dd782acaefc6f60c58bff56b Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 11 Oct 2003 13:45:58 +0000 Subject: [PATCH] Ajout info de remise lors de la creation depuis une propale --- htdocs/compta/facture.php | 48 ++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 1da32dc9b43..8df85ca1c9e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -453,9 +453,9 @@ if ($action == 'create') print ''; print ''; - print ''; + print ''; - $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, pt.qty, p.rowid as prodid"; + $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, pt.qty, p.rowid as prodid, pt.remise_percent"; $sql .= " FROM llx_propaldet as pt, llx_product as p WHERE pt.fk_product = p.rowid AND pt.fk_propal = $propalid"; $sql .= " ORDER BY pt.rowid ASC"; $result = $db->query($sql); @@ -468,14 +468,38 @@ if ($action == 'create') { $objp = $db->fetch_object($i); $var=!$var; - print "\n"; + print "\n"; print ''; print ""; - print ''; + print ''; print "\n"; $i++; } } + $sql = "SELECT pt.rowid, pt.description as product, pt.price, pt.qty, pt.remise_percent"; + $sql .= " FROM llx_propaldet as pt WHERE pt.fk_propal = $propalid AND pt.fk_product = 0"; + $sql .= " ORDER BY pt.rowid ASC"; + if ($db->query($sql)) + { + $num = $db->num_rows(); + $i = 0; + while ($i < $num) + { + $objp = $db->fetch_object($i); + $var=!$var; + print "\n"; + print ''; + print ''; + print ''; + print "\n"; + $i++; + } + } + else + { + print $sql; + } + print '
RéfProduitPrix Qté.
PrixRemiseQté.
[$objp->ref]
[$objp->ref]'.$objp->product.'".price($objp->price)." '.$objp->remise_percent.' %".$objp->qty."
 '.$objp->product.''.price($objp->price).''.$objp->remise_percent.' %".$objp->qty."
'; } } @@ -530,9 +554,7 @@ else { print ''; } - - $_MONNAIE="euros"; - + /* * Paiements */ @@ -594,7 +616,7 @@ else print 'Montant'; print ''.price($fac->total_ht).''; - print 'euros HT'; + print ''.MAIN_MONNAIE.' HT'; if ($fac->remise_percent > 0) { @@ -604,9 +626,9 @@ else } print 'TVA'.price($fac->total_tva).''; - print 'euros'; + print ''.MAIN_MONNAIE.''; print 'Total'.price($fac->total_ttc).''; - print 'euros TTC'; + print ''.MAIN_MONNAIE.' TTC'; if ($fac->note) { print 'Note : '.nl2br($fac->note).""; @@ -823,9 +845,9 @@ else if ($fac->statut > 0) { - print '-'; - // RODO TODO - //print 'Récurrente'; + //print '-'; + + print 'Récurrente'; } else {