From 758ce8ecffb75fa2cdd364e795d326dc9ff26ee7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 4 Apr 2007 10:44:44 +0000 Subject: [PATCH] Fix: affichage des avoirs --- htdocs/compta/commande/fiche.php | 16 ++++++++++++++-- htdocs/compta/facture.php | 2 +- htdocs/compta/propal.php | 14 +++++++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php index 6b47cdf92e4..bf382f70f8e 100644 --- a/htdocs/compta/commande/fiche.php +++ b/htdocs/compta/commande/fiche.php @@ -296,7 +296,7 @@ if ($_GET["id"] > 0) /* * Lignes de commandes */ - $sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, l.info_bits,'; + $sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.fk_remise_except, l.remise_percent, l.subprice, l.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."commandedet as l"; @@ -351,7 +351,19 @@ if ($_GET["id"] > 0) print ''; print img_object($langs->trans("ShowReduc"),'reduc').' '.$langs->trans("Discount"); print ''; - if ($objp->description) print ' - '.nl2br($objp->description); + if ($objp->description) + { + if ($objp->description == '(CREDIT_NOTE)') + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + print ' - '.$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); + } + else + { + print ' - '.nl2br($objp->description); + } + } } else { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 949777bd22d..d050c6d737d 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -139,7 +139,7 @@ if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->facture->creer) $_GET['facid']=$_REQUEST['facid']; } -if ($_POST['action'] == "setabsolutediscount" && $user->rights->propale->creer) +if ($_POST['action'] == "setabsolutediscount" && $user->rights->facture->creer) { if ($_POST["remise_id"]) { diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index c0382b49ba3..30fbb643b04 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -371,7 +371,19 @@ if ($_GET["propalid"] > 0) print ''; print img_object($langs->trans("ShowReduc"),'reduc').' '.$langs->trans("Discount"); print ''; - if ($objp->description) print ' - '.nl2br($objp->description); + if ($objp->description) + { + if ($objp->description == '(CREDIT_NOTE)') + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + print ' - '.$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); + } + else + { + print ' - '.nl2br($objp->description); + } + } } else {