From 835f1b1391097136515d8b7b0fad157c221a2536 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Aug 2006 21:04:54 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Les=20lignes=20de=20type=20remise=20n'?= =?UTF-8?q?=E9tait=20pas=20d=E9tect=E9es=20comme=20tel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/propal.php | 58 +++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 2a270b0e9a3..a89075e9602 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -290,10 +290,14 @@ if ($_GET["propalid"] > 0) * Lignes de propale * */ - $sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, p.label as product, p.ref, p.fk_product_type, p.rowid as prodid'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; - $sql .= ' WHERE pt.fk_propal = '.$propal->id; - $sql .= ' ORDER BY pt.rang ASC'; + $sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.fk_remise_except,'; + $sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,'; + $sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid,'; + $sql.= ' p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; + $sql.= ' WHERE pt.fk_propal = '.$propal->id; + $sql.= ' ORDER BY pt.rang ASC, pt.rowid'; $resql = $db->query($sql); if ($resql) { @@ -347,23 +351,35 @@ if ($_GET["propalid"] > 0) print ($objp->description && $objp->description!=$objp->product)?'
'.stripslashes(nl2br($objp->description)):''; print ''; } - else - { - print ''.stripslashes(nl2br($objp->description)); - if ($objp->date_start && $objp->date_end) - { - print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; - } - if ($objp->date_start && ! $objp->date_end) - { - print ' (A partir du '.dolibarr_print_date($objp->date_start).')'; - } - if (! $objp->date_start && $objp->date_end) - { - print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; - } - print "\n"; - } + else + { + print ''; + print ''; // ancre pour retourner sur la ligne + if (($objp->info_bits & 2) == 2) + { + print ''; + print img_object($langs->trans("ShowReduc"),'reduc').' '.$langs->trans("Discount"); + print ''; + if ($objp->description) print ' - '.nl2br($objp->description); + } + else + { + print nl2br($objp->description); + if ($objp->date_start && $objp->date_end) + { + print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; + } + if ($objp->date_start && ! $objp->date_end) + { + print ' (A partir du '.dolibarr_print_date($objp->date_start).')'; + } + if (! $objp->date_start && $objp->date_end) + { + print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; + } + } + print "\n"; + } print ''.$objp->tva_tx.'%'; print ''.price($objp->subprice)."\n"; print ''.$objp->qty.'';