From d4bbdd7207fd6bc16f37ac9613f62eb358c2790c Mon Sep 17 00:00:00 2001 From: rGaillard Date: Wed, 5 Sep 2012 14:10:29 +0000 Subject: [PATCH] // 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 --- classes/order/OrderPayment.php | 2 +- controllers/admin/AdminOrdersController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/order/OrderPayment.php b/classes/order/OrderPayment.php index fc0d93455..412d6b796 100644 --- a/classes/order/OrderPayment.php +++ b/classes/order/OrderPayment.php @@ -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), diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 48187c713..667cfdcdb 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -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');