diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index cb885dbcf3f9..7a58ad08bb8c 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -112,13 +112,13 @@ class ClientController extends BaseController Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT); $actionLinks = [ - ['label' => trans('texts.create_invoice'), 'url' => URL::to('invoices/create/'.$client->public_id)], - ['label' => trans('texts.enter_payment'), 'url' => URL::to('payments/create/'.$client->public_id)], - ['label' => trans('texts.enter_credit'), 'url' => URL::to('credits/create/'.$client->public_id)], + ['label' => trans('texts.create_invoice'), 'url' => '/invoices/create/'.$client->public_id], + ['label' => trans('texts.enter_payment'), 'url' => '/payments/create/'.$client->public_id], + ['label' => trans('texts.enter_credit'), 'url' => '/credits/create/'.$client->public_id], ]; if (Utils::isPro()) { - array_unshift($actionLinks, ['label' => trans('texts.create_quote'), 'url' => URL::to('quotes/create/'.$client->public_id)]); + array_unshift($actionLinks, ['label' => trans('texts.create_quote'), 'url' => '/quotes/create/'.$client->public_id]); } $data = array( diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 5c31f19e81aa..7e3a5e84196a 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -54,21 +54,25 @@ class DashboardController extends BaseController ->where('activity_type_id', '>', 0) ->orderBy('created_at', 'desc')->take(14)->get(); - $pastDue = Invoice::scope() - ->where('due_date', '<', date('Y-m-d')) - ->where('balance', '>', 0) - ->where('is_recurring', '=', false) - ->where('is_quote', '=', false) - ->where('is_deleted', '=', false) - ->orderBy('due_date', 'asc')->take(6)->get(); + $pastDue = Invoice::scope()->whereHas('client', function($query) { + $query->where('deleted_at', '=', null); + }) + ->where('due_date', '<', date('Y-m-d')) + ->where('balance', '>', 0) + ->where('is_recurring', '=', false) + ->where('is_quote', '=', false) + ->where('is_deleted', '=', false) + ->orderBy('due_date', 'asc')->take(6)->get(); - $upcoming = Invoice::scope() - ->where('due_date', '>=', date('Y-m-d')) - ->where('balance', '>', 0) - ->where('is_recurring', '=', false) - ->where('is_quote', '=', false) - ->where('is_deleted', '=', false) - ->orderBy('due_date', 'asc')->take(6)->get(); + $upcoming = Invoice::scope()->whereHas('client', function($query) { + $query->where('deleted_at', '=', null); + }) + ->where('due_date', '>=', date('Y-m-d')) + ->where('balance', '>', 0) + ->where('is_recurring', '=', false) + ->where('is_quote', '=', false) + ->where('is_deleted', '=', false) + ->orderBy('due_date', 'asc')->take(6)->get(); $data = [ 'paidToDate' => $paidToDate, diff --git a/app/Http/routes.php b/app/Http/routes.php index 11977f237886..28647194460b 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -73,16 +73,6 @@ get('/password/reset/{token}', array('as' => 'forgot', 'uses' => 'Auth\PasswordC post('/password/reset', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postReset')); get('/user/confirm/{code}', 'UserController@confirm'); -/* -// Confide routes -Route::get('login', 'UserController@login'); -Route::post('login', 'UserController@do_login'); -Route::get('forgot_password', 'UserController@forgot_password'); -Route::post('forgot_password', 'UserController@do_forgot_password'); -Route::get('user/reset/{token?}', 'UserController@reset_password'); -Route::post('user/reset', 'UserController@do_reset_password'); -Route::get('logout', 'UserController@logout'); -*/ if (Utils::isNinja()) { Route::post('/signup/register', 'AccountController@doRegister'); @@ -513,7 +503,6 @@ Validator::extend('has_credit', function($attribute, $value, $parameters) { return $credit >= $amount; }); - /* // Log all SQL queries to laravel.log Event::listen('illuminate.query', function($query, $bindings, $time, $name) diff --git a/composer.json b/composer.json index 08c769297bbb..23390e0c1890 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "patricktalmadge/bootstrapper": "5.5.x", "anahkiasen/former": "4.0.*@dev", "barryvdh/laravel-debugbar": "~2.0.2", - "chumper/datatable": "dev-develop", + "chumper/datatable": "dev-develop#7fa47cb", "omnipay/omnipay": "2.3.x", "intervention/image": "dev-master", "webpatser/laravel-countries": "dev-master", diff --git a/composer.lock b/composer.lock index e262ed433f96..55b4a6af45b4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "4093891914bbd46ffab78737da36898a", + "hash": "456867b27b6caddd5d681f7bad019be4", "packages": [ { "name": "alfaproject/omnipay-neteller", @@ -335,12 +335,12 @@ "source": { "type": "git", "url": "https://github.com/Chumper/Datatable.git", - "reference": "7fa47cb5469f07c620fb69dee94b8e1a96943ee2" + "reference": "7fa47cb" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/Chumper/Datatable/zipball/7fa47cb5469f07c620fb69dee94b8e1a96943ee2", - "reference": "7fa47cb5469f07c620fb69dee94b8e1a96943ee2", + "reference": "7fa47cb", "shasum": "" }, "require": { diff --git a/readme.md b/readme.md index 0602323130b0..ec3f19b5a709 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,5 @@ # Invoice Ninja ### [https://www.invoiceninja.com](https://www.invoiceninja.com) -##### Please [click here](https://bitnami.com/stack/invoice-ninja) to vote for us to be added to Bitnami's one-click install library If you'd like to use our code to sell your own invoicing app we have an affiliate program. Get in touch for more details. diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index c1bb719cba95..1983f0c258c1 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -137,8 +137,10 @@

 

 

+ + diff --git a/resources/views/clients/show.blade.php b/resources/views/clients/show.blade.php index 15392777e379..9cd6e069ac82 100644 --- a/resources/views/clients/show.blade.php +++ b/resources/views/clients/show.blade.php @@ -15,7 +15,7 @@ @endif @if ($client->trashed()) - {!! Button::primary(trans('texts.restore_client'), ['onclick' => 'onRestoreClick()']) !!} + {!! Button::primary(trans('texts.restore_client'))->withAttributes(['onclick' => 'onRestoreClick()']) !!} @else {!! DropdownButton::normal(trans('texts.edit_client')) ->withAttributes(['class'=>'normalDropDown']) diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 32755bf0b9ed..14be9e4f1f41 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -94,14 +94,12 @@ @foreach ($pastDue as $invoice) - @if (!$invoice->client->trashed()) {!! $invoice->getLink() !!} {{ $invoice->client->getDisplayName() }} {{ Utils::fromSqlDate($invoice->due_date) }} {{ Utils::formatMoney($invoice->balance, $invoice->client->currency_id) }} - @endif @endforeach @@ -123,14 +121,12 @@ @foreach ($upcoming as $invoice) - @if (!$invoice->client->trashed()) {!! $invoice->getLink() !!} {{ $invoice->client->getDisplayName() }} {{ Utils::fromSqlDate($invoice->due_date) }} {{ Utils::formatMoney($invoice->balance, $invoice->client->currency_id) }} - @endif @endforeach