diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d83208c5c1b..9a6838d4886 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2629,7 +2629,7 @@ abstract class CommonObject if ($conf->global->MARGIN_TYPE == "1") print ''.$langs->trans('BuyingPrice').''; else - print ''.$langs->trans('BuyingCost').''; + print ''.$langs->trans('CostPrice').''; if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''.$langs->trans('MarginRate').''; if (! empty($conf->global->DISPLAY_MARK_RATES)) @@ -3029,7 +3029,10 @@ abstract class CommonObject print ''; print ''.$langs->trans('Margins').''; print ''.$langs->trans('SellingPrice').''; - print ''.$langs->trans('BuyingPrice').''; + if ($conf->global->MARGIN_TYPE == "1") + print ''.$langs->trans('BuyingPrice').''; + else + print ''.$langs->trans('CostPrice').''; print ''.$langs->trans('Margin').''; if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''.$langs->trans('MarginRate').''; diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 5c4b055ddf0..1b8e4e6f2e9 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -44,7 +44,13 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob if (! empty($usemargins)) { ?> - trans('BuyingPrice'); ?> + + global->MARGIN_TYPE == "1") + echo $langs->trans('BuyingPrice'); + else + echo $langs->trans('CostPrice'); + ?> global->DISPLAY_MARGIN_RATES)) $colspan++; if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index 6bfd94fa817..0aa4dc107c2 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -50,8 +50,14 @@ if (! empty($usemargins)) if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; ?> - trans('BuyingPrice'); ?> - + global->MARGIN_TYPE == "1") + echo $langs->trans('BuyingPrice'); + else + echo $langs->trans('CostPrice'); + ?> +   diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 3dfe6de2d64..67ffbad93ce 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -73,12 +73,9 @@ if (! empty($idprod)) $objp = $db->fetch_object($result); $title = $objp->nom.' - '.$objp->ref_fourn.' - '; - $label = ''; if ($objp->quantity == 1) { - $label.= price($objp->fprice).getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit")); - $title.= price($objp->fprice); $title.= getCurrencySymbol($conf->currency)."/"; @@ -100,8 +97,6 @@ if (! empty($idprod)) $title.=" - "; $title.= price($objp->unitprice).getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit")); - $label.= price($objp->unitprice).getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit")); - $price = $objp->unitprice; } if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) { @@ -111,6 +106,8 @@ if (! empty($idprod)) } if ($objp->duration) $label .= " - ".$objp->duration; + $label = price($price).getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit")); + $prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title); $i++; }