// Amount of order payment may be negative

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17192 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-09-05 14:10:29 +00:00
parent 792f3bb601
commit d4bbdd7207
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ class OrderPaymentCore extends ObjectModel
'fields' => array(
'order_reference' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 9),
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isNegativePrice', 'required' => true),
'payment_method' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'conversion_rate' => array('type' => self::TYPE_INT, 'validate' => 'isFloat'),
'transaction_id' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 254),
+1 -1
View File
@@ -819,7 +819,7 @@ class AdminOrdersControllerCore extends AdminController
if (!Validate::isLoadedObject($order))
$this->errors[] = Tools::displayError('Order can\'t be found');
elseif (!Validate::isPrice($amount))
elseif (!Validate::isNegativePrice($amount))
$this->errors[] = Tools::displayError('Amount is invalid');
elseif (!Validate::isString(Tools::getValue('payment_method')))
$this->errors[] = Tools::displayError('Payment method is invalid');