From eed3218153575eac52201fa7bd07d6300b4b4769 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jun 2026 13:06:51 +0200 Subject: [PATCH] Fix NaN set into unit price --- htdocs/core/tpl/objectline_create.tpl.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index cebe60f6271..082bab3eec7 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -1267,9 +1267,13 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) { if (has_multicurrency_up === false) { if (typeof up_locale === 'undefined') { - jQuery("#price_ht").val(up); + if (!Number.isNaN(up)) { + jQuery("#price_ht").val(up); + } } else { - jQuery("#price_ht").val(up_locale); + if (!Number.isNaN(up_locale)) { + jQuery("#price_ht").val(up_locale); + } } }