From b20b82df3d40f95d05326678399358015870ef69 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2013 13:04:38 +0200 Subject: [PATCH] Fix: we must use conf-currency as parameter of method price instead of using langs->getCurrencySymbol --- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/fourn/ajax/getSupplierPrices.php | 23 +++++++---------------- htdocs/fourn/facture/fiche.php | 2 +- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c81afc72ad9..d8bdb60d8a4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1775,8 +1775,8 @@ class Form { $opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/".$objp->quantity; $outval.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/".$objp->quantity; - $opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding - $outval.= $langs->transnoentities("Units"); + $opt.= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding + $outval.= ' '.$langs->transnoentities("Units"); } if ($objp->quantity >= 1) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 65f3eb9ee79..dc39538fe7b 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -79,35 +79,26 @@ if (! empty($idprod)) if ($objp->quantity == 1) { - $title.= price($price); - $title.= $langs->getCurrencySymbol($conf->currency)."/"; + $title.= price($price,0,$langs,0,0,-1,$conf->currency)."/"; } + $title.= $objp->quantity.' '.($objp->quantity == 1 ? $langs->trans("Unit") : $langs->trans("Units")); - $title.= $objp->quantity.' '; - - if ($objp->quantity == 1) - { - $title.= strtolower($langs->trans("Unit")); - } - else - { - $title.= strtolower($langs->trans("Units")); - } if ($objp->quantity > 1) { $title.=" - "; - $title.= price($unitprice).$langs->getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit")); + $title.= price($unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); $price = $unitprice; } - if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) { + if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) + { $title.=" + "; - $title.= price($objp->unitcharges).$langs->getCurrencySymbol($conf->currency); + $title.= price($objp->unitcharges,0,$langs,0,0,-1,$conf->currency); $price += $objp->unitcharges; } if ($objp->duration) $label .= " - ".$objp->duration; - $label = price($price).$langs->getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit")); + $label = price($price,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); $prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title); $i++; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 4e52c474149..7de2b910237 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -2221,7 +2221,7 @@ else /* * Linked object block - */ + */ $somethingshown=$object->showLinkedObjectBlock(); print '
';