From 3f9efc537b09f142baeb249ea4e1f8a6c88c9f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Mon, 7 Dec 2015 14:15:00 +0100 Subject: [PATCH] FIX #3953 Don't round supplier price The price is already rounded when inserted on the product page. It's also rounded at display. There's no need to round it here. Rounding it leads to serious calculation errors. --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index fd5a81240ef..7244711bb43 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -554,7 +554,7 @@ jQuery(document).ready(function() { /* Define default price at loading */ var defaultprice = $("#fournprice_predef").find('option:selected').attr("price"); - $("#buying_price").val(parseFloat(defaultprice).toFixed(global->MAIN_MAX_DECIMALS_UNIT ? $conf->global->MAIN_MAX_DECIMALS_UNIT : 5); ?>)); + $("#buying_price").val(defaultprice); $("#fournprice_predef").change(function() { console.log("change on fournprice_predef");