diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
index a69ad878236..0290d4d6ea8 100644
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
@@ -93,21 +93,6 @@ public function __construct()
));
}
- if ($this->_isAllowedAction('creditmemo') && $order->canCreditmemo()) {
- $confirmationMessage = $coreHelper->jsQuoteEscape(
- Mage::helper('sales')->__('This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you wish to proceed?')
- );
- $onClick = "setLocation('{$this->getCreditmemoUrl()}')";
- if ($order->getPayment()->getMethodInstance()->isGateway()) {
- $onClick = "confirmSetLocation('{$confirmationMessage}', '{$this->getCreditmemoUrl()}')";
- }
- $this->_addButton('order_creditmemo', array(
- 'label' => Mage::helper('sales')->__('Credit Memo'),
- 'onclick' => $onClick,
- 'class' => 'go'
- ));
- }
-
// invoice action intentionally
if ($this->_isAllowedAction('invoice') && $order->canVoidPayment()) {
$confirmationMessage = $coreHelper->jsQuoteEscape(
@@ -180,6 +165,21 @@ public function __construct()
));
}
+ if ($this->_isAllowedAction('creditmemo') && $order->canCreditmemo()) {
+ $onClick = "setLocation('{$this->getCreditmemoUrl()}')";
+ if ($order->getPayment()->getMethodInstance()->isGateway()) {
+ $confirmationMessage = $coreHelper->jsQuoteEscape(
+ Mage::helper('sales')->__('This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you wish to proceed?')
+ );
+ $onClick = "confirmSetLocation('{$confirmationMessage}', '{$this->getCreditmemoUrl()}')";
+ }
+ $this->_addButton('order_creditmemo', array(
+ 'label' => Mage::helper('sales')->__('Credit Memo'),
+ 'onclick' => $onClick,
+ 'class' => 'go'
+ ));
+ }
+
if ($this->_isAllowedAction('reorder')
&& $this->helper('sales/reorder')->isAllowed($order->getStore())
&& $order->canReorderIgnoreSalable()