diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 82a3c621db8..6dfd05354d8 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -176,7 +176,7 @@ if (empty($reshook))
$result=$object->update($object->id, $user);
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
-
+
// update order min amount
if ($action == 'setorder_min_amount')
{
@@ -412,7 +412,7 @@ if ($object->id > 0)
print '';
print '';
-
+
print '
';
print '| ';
print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer);
@@ -422,7 +422,7 @@ if ($object->id > 0)
print ' | ';
print '
';
}
-
+
// Multiprice level
if (! empty($conf->global->PRODUIT_MULTIPRICES))
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index 2052b63fe0c..b1523f3bbf9 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -1091,7 +1091,7 @@ class ExpenseReport extends CommonObject
{
$num = $this->ref;
}
- if (empty($num)) return -1;
+ if (empty($num) || $num < 0) return -1;
$this->newref = $num;