Skip to content

Commit

Permalink
Fixed issue #19942 in 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Govind Sharma authored Jan 29, 2019
1 parent fb55bb2 commit 0ec113f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,7 @@ public function execute()
}
}
$transactionSave->save();

if (!empty($data['do_shipment'])) {
$this->messageManager->addSuccess(__('You created the invoice and shipment.'));
} else {
$this->messageManager->addSuccess(__('The invoice has been created.'));
}


// send invoice/shipment emails
try {
if (!empty($data['send_email'])) {
Expand All @@ -206,6 +200,12 @@ public function execute()
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
$this->messageManager->addError(__('We can\'t send the invoice email right now.'));
}
if (!empty($data['do_shipment'])) {
$this->messageManager->addSuccess(__('You created the invoice and shipment.'));
} else {
$this->messageManager->addSuccess(__('The invoice has been created.'));
}

if ($shipment) {
try {
if (!empty($data['send_email'])) {
Expand All @@ -216,6 +216,13 @@ public function execute()
$this->messageManager->addError(__('We can\'t send the shipment right now.'));
}
}

if (!empty($data['do_shipment'])) {
$this->messageManager->addSuccess(__('You created the invoice and shipment.'));
} else {
$this->messageManager->addSuccess(__('The invoice has been created.'));
}

$this->_objectManager->get(\Magento\Backend\Model\Session::class)->getCommentText(true);
return $resultRedirect->setPath('sales/order/view', ['order_id' => $orderId]);
} catch (LocalizedException $e) {
Expand Down

0 comments on commit 0ec113f

Please sign in to comment.