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 '| Réf | Produit | ';
- print 'Prix | | Qté. |
';
+ print 'Prix | Remise | Qté. | ';
- $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 "| [$objp->ref] | \n";
+ print "
| [$objp->ref] | \n";
print ''.$objp->product.' | ';
print "".price($objp->price)." | ";
- print ' | ';
+ print ''.$objp->remise_percent.' % | ';
print "".$objp->qty." |
\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 ''.$objp->product.' | ';
+ print ''.price($objp->price).' | ';
+ print ''.$objp->remise_percent.' % | ';
+ print "".$objp->qty." |
\n";
+ $i++;
+ }
+ }
+ else
+ {
+ print $sql;
+ }
+
print '
';
}
}
@@ -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
{