diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index 4715c41de3..172f86e3b0 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -315,9 +315,17 @@ class InvoiceController extends \BaseController { return InvoiceController::cloneInvoice($publicId); } else if ($action == 'email') - { - $this->mailer->sendInvoice($invoice); - Session::flash('message', 'Successfully emailed invoice'.$message); + { + if (Auth::user()->confirmed) + { + $this->mailer->sendInvoice($invoice); + Session::flash('message', 'Successfully emailed invoice'.$message); + } + else + { + Session::flash('message', 'Successfully saved invoice'.$message); + Session::flash('error', 'Please sign up to email an invoice'); + } } else { diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php index aa6b72ebff..91e93febe1 100755 --- a/app/controllers/UserController.php +++ b/app/controllers/UserController.php @@ -75,7 +75,17 @@ class UserController extends BaseController { if( Confide::user() ) { Event::fire('user.login'); - return Redirect::to('/invoices/create'); + + $invoice = Invoice::scope()->orderBy('id', 'desc')->first(); + + if ($invoice) + { + return Redirect::to('/invoices/' . $invoice->public_id); + } + else + { + return Redirect::to('/invoices/create'); + } } else { diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index cb1182e142..5394a87a40 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -406,37 +406,6 @@ - - - -