// fix bug on Payment addition

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11148 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aFolletete
2011-12-12 16:51:47 +00:00
parent 2fa5744010
commit 0db603d498
3 changed files with 9 additions and 4 deletions
+5 -1
View File
@@ -572,8 +572,12 @@ class AdminOrdersControllerCore extends AdminController
elseif (!Validate::isDate(Tools::getValue('payment_date')))
$this->_errors[] = Tools::displayError('Date is invalid');
else
{
if (!$order->addOrderPayment($amount, Tools::getValue('payment_method'), Tools::getValue('payment_transaction_id'), $currency, Tools::getValue('payment_date')))
$this->_errors[] = Tools::displayError('An error occured on adding of order payment');
else
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);
}
}
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
@@ -585,7 +589,7 @@ class AdminOrdersControllerCore extends AdminController
$payment_module = Module::getInstanceByName($module_name);
$cart = new Cart((int)$id_cart);
$payment_module->validateOrder((int)$cart->id, (int)$id_order_state, $cart->getOrderTotal(true, Cart::BOTH), $payment_module->displayName, $this->l(sprintf('Manual order - ID Employee :%1', (int)Context::getContext()->cookie->id_employee)));
if($payment_module->currentOrder)
if ($payment_module->currentOrder)
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token);
}
else