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
  • Loading branch information
sidolov authored Feb 8, 2019
2 parents fcbb5c1 + a521238 commit 14af3f8
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 14af3f8

Please sign in to comment.