From fb25f479f2818205fb15950ab88c6e4b212e6629 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Tue, 4 Aug 2015 13:39:01 +0200 Subject: [PATCH 1/2] unit price not used if qty = 1 this line is too long for add unused information --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5287155357f..682abdd66d1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2110,7 +2110,7 @@ class Form $outval.= ' '.$langs->transnoentities("Units"); } - if ($objp->quantity >= 1) + if ($objp->quantity > 1) { $opt.=" (".price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding $outval.=" (".price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding From 83c4652a1629f84f98af1f8f2e2b773b1cc0f563 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Tue, 4 Aug 2015 15:22:36 +0200 Subject: [PATCH 2/2] don't display ref_fourn if it's same as ref decrease size of the select list --- htdocs/core/class/html.form.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 682abdd66d1..31f1372b18e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2072,10 +2072,12 @@ class Form if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','$1',$label,1); $opt.=$objp->ref; - if (! empty($objp->idprodfournprice)) $opt.=' ('.$objp->ref_fourn.')'; + if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + $opt.=' ('.$objp->ref_fourn.')'; $opt.=' - '; $outval.=$objRef; - if (! empty($objp->idprodfournprice)) $outval.=' ('.$objRefFourn.')'; + if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + $outval.=' ('.$objRefFourn.')'; $outval.=' - '; $opt.=dol_trunc($label, 72).' - '; $outval.=dol_trunc($label, 72).' - ';