// 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:
@@ -48,7 +48,7 @@ class OrderPaymentCore extends ObjectModel
|
|||||||
'fields' => array(
|
'fields' => array(
|
||||||
'order_reference' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 9),
|
'order_reference' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 9),
|
||||||
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
'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'),
|
'payment_method' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
|
||||||
'conversion_rate' => array('type' => self::TYPE_INT, 'validate' => 'isFloat'),
|
'conversion_rate' => array('type' => self::TYPE_INT, 'validate' => 'isFloat'),
|
||||||
'transaction_id' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 254),
|
'transaction_id' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 254),
|
||||||
|
|||||||
@@ -819,7 +819,7 @@ class AdminOrdersControllerCore extends AdminController
|
|||||||
|
|
||||||
if (!Validate::isLoadedObject($order))
|
if (!Validate::isLoadedObject($order))
|
||||||
$this->errors[] = Tools::displayError('Order can\'t be found');
|
$this->errors[] = Tools::displayError('Order can\'t be found');
|
||||||
elseif (!Validate::isPrice($amount))
|
elseif (!Validate::isNegativePrice($amount))
|
||||||
$this->errors[] = Tools::displayError('Amount is invalid');
|
$this->errors[] = Tools::displayError('Amount is invalid');
|
||||||
elseif (!Validate::isString(Tools::getValue('payment_method')))
|
elseif (!Validate::isString(Tools::getValue('payment_method')))
|
||||||
$this->errors[] = Tools::displayError('Payment method is invalid');
|
$this->errors[] = Tools::displayError('Payment method is invalid');
|
||||||
|
|||||||
Reference in New Issue
Block a user