Skip to content

Commit acd598b

Browse files
author
vpaladiychuk
committed
MAGETWO-32554: Refactor Adminhtml/order/invoice directory
1 parent 3b8ba0c commit acd598b

File tree

1 file changed

+4
-4
lines changed
  • app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice

1 file changed

+4
-4
lines changed

app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ public function execute()
114114
$this->_objectManager->get('Magento\Backend\Model\Session')->setCommentText($data['comment_text']);
115115
}
116116

117+
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
118+
$resultRedirect = $this->resultRedirectFactory->create();
117119
try {
118120
$invoiceData = $this->getRequest()->getParam('invoice', []);
119121
$invoiceItems = isset($invoiceData['items']) ? $invoiceData['items'] : [];
@@ -210,15 +212,13 @@ public function execute()
210212
}
211213
}
212214
$this->_objectManager->get('Magento\Backend\Model\Session')->getCommentText(true);
215+
return $resultRedirect->setPath('sales/order/view', ['order_id' => $orderId]);
213216
} catch (Exception $e) {
214217
$this->messageManager->addError($e->getMessage());
215218
} catch (\Exception $e) {
216219
$this->messageManager->addError(__('We can\'t save the invoice.'));
217220
$this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e);
218221
}
219-
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
220-
$resultRedirect = $this->resultRedirectFactory->create();
221-
$resultRedirect->setPath('sales/*/new', ['order_id' => $orderId]);
222-
return $resultRedirect;
222+
return $resultRedirect->setPath('sales/*/new', ['order_id' => $orderId]);
223223
}
224224
}

0 commit comments

Comments
 (0)