Skip to content

Commit

Permalink
ENGCOM-4142: Fixed issue #19942 in 2.2 #20776
Browse files Browse the repository at this point in the history
 - Merge Pull Request #20776 from cedcommerce/magento2:govind2.2-DevelopPr1
 - Merged commits:
   1. 0ec113f
   2. a44cb0e
  • Loading branch information
magento-engcom-team committed Feb 5, 2019
2 parents 1548d5a + a44cb0e commit a521238
Showing 1 changed file with 9 additions and 7 deletions.
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,7 @@ 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 ($shipment) {
try {
if (!empty($data['send_email'])) {
Expand All @@ -216,6 +211,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 a521238

Please sign in to comment.