From 926462e2186291b7360ac4ee62c1272a9010e08f Mon Sep 17 00:00:00 2001 From: kkhelifa-opendsi Date: Sun, 18 Feb 2024 22:56:19 +0100 Subject: [PATCH 1/3] FIX: Not trancate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211) --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2d0291e1bd3..cd9f44130b9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5938,9 +5938,9 @@ class Form print ''; } else { if (!empty($rate)) { - print price($rate, 1, $langs, 1, 0); + print price($rate, 1, $langs, 0, 0); if ($currency && $rate != 1) { - print '   (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; + print '   (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; } } else { print 1; From aa068bd0a0d39a9e4608946d0c0c515f168c8918 Mon Sep 17 00:00:00 2001 From: atm-sami <139965072+atm-sami@users.noreply.github.com> Date: Mon, 19 Feb 2024 09:35:59 +0100 Subject: [PATCH 2/3] 18.0 FIX multiplication error (#28266) * add new hook context for mo production card * remove consumed and produced line when we clone mo * Fix multiplication error in actions_addupdatedelete.inc.php --- htdocs/core/actions_addupdatedelete.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 086b37aa501..25458a612e5 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -95,7 +95,9 @@ if ($action == 'add' && !empty($permissiontoadd)) { } elseif ($object->fields[$key]['type'] == 'datetime') { $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); } elseif ($object->fields[$key]['type'] == 'duration') { - $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); + $hour = intval(GETPOST($key.'hour', 'int')); + $min = intval(GETPOST($key.'min', 'int')); + $value = 60 * 60 * $hour + 60 * $min; } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($object->fields[$key]['type'] == 'boolean') { From 832284e7107dac97c44af2757bf640b7935553d8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 19 Feb 2024 15:20:08 +0100 Subject: [PATCH 3/3] FIX avoid error "Column 'entity' in where clause is ambiguous" (#28270) --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index fd231091af1..82e42792144 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -71,7 +71,7 @@ function societe_prepare_head(Societe $object) $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " WHERE p.fk_soc = ".((int) $object->id); - $sql .= " AND entity IN (".getEntity($object->element).")"; + $sql .= " AND p.entity IN (".getEntity($object->element).")"; // Add where from hooks $parameters = array('contacttab' => true); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook