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') { 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; 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