Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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()
Expand Down