Skip to content

Commit 4c21929

Browse files
authored
Move Credit Memo at the end of the buttons list (#2392)
1 parent c2e7c0b commit 4c21929

File tree

1 file changed

+15
-15
lines changed
  • app/code/core/Mage/Adminhtml/Block/Sales/Order

1 file changed

+15
-15
lines changed

app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,6 @@ public function __construct()
9393
));
9494
}
9595

96-
if ($this->_isAllowedAction('creditmemo') && $order->canCreditmemo()) {
97-
$confirmationMessage = $coreHelper->jsQuoteEscape(
98-
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?')
99-
);
100-
$onClick = "setLocation('{$this->getCreditmemoUrl()}')";
101-
if ($order->getPayment()->getMethodInstance()->isGateway()) {
102-
$onClick = "confirmSetLocation('{$confirmationMessage}', '{$this->getCreditmemoUrl()}')";
103-
}
104-
$this->_addButton('order_creditmemo', array(
105-
'label' => Mage::helper('sales')->__('Credit Memo'),
106-
'onclick' => $onClick,
107-
'class' => 'go'
108-
));
109-
}
110-
11196
// invoice action intentionally
11297
if ($this->_isAllowedAction('invoice') && $order->canVoidPayment()) {
11398
$confirmationMessage = $coreHelper->jsQuoteEscape(
@@ -180,6 +165,21 @@ public function __construct()
180165
));
181166
}
182167

168+
if ($this->_isAllowedAction('creditmemo') && $order->canCreditmemo()) {
169+
$onClick = "setLocation('{$this->getCreditmemoUrl()}')";
170+
if ($order->getPayment()->getMethodInstance()->isGateway()) {
171+
$confirmationMessage = $coreHelper->jsQuoteEscape(
172+
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?')
173+
);
174+
$onClick = "confirmSetLocation('{$confirmationMessage}', '{$this->getCreditmemoUrl()}')";
175+
}
176+
$this->_addButton('order_creditmemo', array(
177+
'label' => Mage::helper('sales')->__('Credit Memo'),
178+
'onclick' => $onClick,
179+
'class' => 'go'
180+
));
181+
}
182+
183183
if ($this->_isAllowedAction('reorder')
184184
&& $this->helper('sales/reorder')->isAllowed($order->getStore())
185185
&& $order->canReorderIgnoreSalable()

0 commit comments

Comments
 (0)