diff --git a/app/Http/Controllers/QuoteController.php b/app/Http/Controllers/QuoteController.php index 93ee5f599b..27eed69b64 100644 --- a/app/Http/Controllers/QuoteController.php +++ b/app/Http/Controllers/QuoteController.php @@ -156,9 +156,11 @@ class QuoteController extends BaseController } } - $invitationKey = $this->invoiceService->approveQuote($invoice, $invitation); - Session::flash('message', trans('texts.quote_is_approved')); - - return Redirect::to("view/{$invitationKey}"); + if ($invoiceInvitationKey = $this->invoiceService->approveQuote($invoice, $invitation)) { + Session::flash('message', trans('texts.quote_is_approved')); + return Redirect::to("view/{$invoiceInvitationKey}"); + } else { + return Redirect::to("view/{$invitationKey}"); + } } }