diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d83208c5c1b0e96af8fe84fcedcd6d6e3900b114..9a6838d48867eeb8bae15d5f85ccc08fad123bd7 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 '<td align="right" width="80">'.$langs->trans('BuyingPrice').'</td>'; else - print '<td align="right" width="80">'.$langs->trans('BuyingCost').'</td>'; + print '<td align="right" width="80">'.$langs->trans('CostPrice').'</td>'; if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print '<td align="right" width="50">'.$langs->trans('MarginRate').'</td>'; if (! empty($conf->global->DISPLAY_MARK_RATES)) @@ -3029,7 +3029,10 @@ abstract class CommonObject print '<tr class="liste_titre">'; print '<td width="30%">'.$langs->trans('Margins').'</td>'; print '<td width="20%" align="right">'.$langs->trans('SellingPrice').'</td>'; - print '<td width="20%" align="right">'.$langs->trans('BuyingPrice').'</td>'; + if ($conf->global->MARGIN_TYPE == "1") + print '<td width="20%" align="right">'.$langs->trans('BuyingPrice').'</td>'; + else + print '<td width="20%" align="right">'.$langs->trans('CostPrice').'</td>'; print '<td width="20%" align="right">'.$langs->trans('Margin').'</td>'; if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print '<td align="right">'.$langs->trans('MarginRate').'</td>'; diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 5c4b055ddf0cfb5d81e00fdfb2e3870f12648979..1b8e4e6f2e91d0121d6b1ee4b7d0e6d9b3d8501b 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)) { ?> - <td align="right"><?php echo $langs->trans('BuyingPrice'); ?></td> + <td align="right"> + <?php + if ($conf->global->MARGIN_TYPE == "1") + echo $langs->trans('BuyingPrice'); + else + echo $langs->trans('CostPrice'); + ?> <?php if (! empty($conf->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 6bfd94fa8175beccd2259130aafc4092e350bf81..0aa4dc107c29a92a5a6796a27d2a7983d5702f0d 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++; ?> - <td align="right"><?php echo $langs->trans('BuyingPrice'); ?></td> - <?php + <td align="right"> + <?php + if ($conf->global->MARGIN_TYPE == "1") + echo $langs->trans('BuyingPrice'); + else + echo $langs->trans('CostPrice'); + ?> + <?php } ?> <td colspan="<?php echo $colspan; ?>"> </td> diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 3dfe6de2d64e11c08e451be34007999a2339dbbe..67ffbad93ce94de6ea3beecdd27c5a686fbd16a8 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++; }