Bug fixes

This commit is contained in:
Hillel Coren 2015-05-15 11:51:22 +03:00
parent 19c1a33d52
commit 935780f7bc
9 changed files with 30 additions and 40 deletions

View File

@ -112,13 +112,13 @@ class ClientController extends BaseController
Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT); Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT);
$actionLinks = [ $actionLinks = [
['label' => trans('texts.create_invoice'), 'url' => URL::to('invoices/create/'.$client->public_id)], ['label' => trans('texts.create_invoice'), 'url' => '/invoices/create/'.$client->public_id],
['label' => trans('texts.enter_payment'), 'url' => URL::to('payments/create/'.$client->public_id)], ['label' => trans('texts.enter_payment'), 'url' => '/payments/create/'.$client->public_id],
['label' => trans('texts.enter_credit'), 'url' => URL::to('credits/create/'.$client->public_id)], ['label' => trans('texts.enter_credit'), 'url' => '/credits/create/'.$client->public_id],
]; ];
if (Utils::isPro()) { 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( $data = array(

View File

@ -54,21 +54,25 @@ class DashboardController extends BaseController
->where('activity_type_id', '>', 0) ->where('activity_type_id', '>', 0)
->orderBy('created_at', 'desc')->take(14)->get(); ->orderBy('created_at', 'desc')->take(14)->get();
$pastDue = Invoice::scope() $pastDue = Invoice::scope()->whereHas('client', function($query) {
->where('due_date', '<', date('Y-m-d')) $query->where('deleted_at', '=', null);
->where('balance', '>', 0) })
->where('is_recurring', '=', false) ->where('due_date', '<', date('Y-m-d'))
->where('is_quote', '=', false) ->where('balance', '>', 0)
->where('is_deleted', '=', false) ->where('is_recurring', '=', false)
->orderBy('due_date', 'asc')->take(6)->get(); ->where('is_quote', '=', false)
->where('is_deleted', '=', false)
->orderBy('due_date', 'asc')->take(6)->get();
$upcoming = Invoice::scope() $upcoming = Invoice::scope()->whereHas('client', function($query) {
->where('due_date', '>=', date('Y-m-d')) $query->where('deleted_at', '=', null);
->where('balance', '>', 0) })
->where('is_recurring', '=', false) ->where('due_date', '>=', date('Y-m-d'))
->where('is_quote', '=', false) ->where('balance', '>', 0)
->where('is_deleted', '=', false) ->where('is_recurring', '=', false)
->orderBy('due_date', 'asc')->take(6)->get(); ->where('is_quote', '=', false)
->where('is_deleted', '=', false)
->orderBy('due_date', 'asc')->take(6)->get();
$data = [ $data = [
'paidToDate' => $paidToDate, 'paidToDate' => $paidToDate,

View File

@ -73,16 +73,6 @@ get('/password/reset/{token}', array('as' => 'forgot', 'uses' => 'Auth\PasswordC
post('/password/reset', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postReset')); post('/password/reset', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postReset'));
get('/user/confirm/{code}', 'UserController@confirm'); 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()) { if (Utils::isNinja()) {
Route::post('/signup/register', 'AccountController@doRegister'); Route::post('/signup/register', 'AccountController@doRegister');
@ -513,7 +503,6 @@ Validator::extend('has_credit', function($attribute, $value, $parameters) {
return $credit >= $amount; return $credit >= $amount;
}); });
/* /*
// Log all SQL queries to laravel.log // Log all SQL queries to laravel.log
Event::listen('illuminate.query', function($query, $bindings, $time, $name) Event::listen('illuminate.query', function($query, $bindings, $time, $name)

View File

@ -18,7 +18,7 @@
"patricktalmadge/bootstrapper": "5.5.x", "patricktalmadge/bootstrapper": "5.5.x",
"anahkiasen/former": "4.0.*@dev", "anahkiasen/former": "4.0.*@dev",
"barryvdh/laravel-debugbar": "~2.0.2", "barryvdh/laravel-debugbar": "~2.0.2",
"chumper/datatable": "dev-develop", "chumper/datatable": "dev-develop#7fa47cb",
"omnipay/omnipay": "2.3.x", "omnipay/omnipay": "2.3.x",
"intervention/image": "dev-master", "intervention/image": "dev-master",
"webpatser/laravel-countries": "dev-master", "webpatser/laravel-countries": "dev-master",

6
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "4093891914bbd46ffab78737da36898a", "hash": "456867b27b6caddd5d681f7bad019be4",
"packages": [ "packages": [
{ {
"name": "alfaproject/omnipay-neteller", "name": "alfaproject/omnipay-neteller",
@ -335,12 +335,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Chumper/Datatable.git", "url": "https://github.com/Chumper/Datatable.git",
"reference": "7fa47cb5469f07c620fb69dee94b8e1a96943ee2" "reference": "7fa47cb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Chumper/Datatable/zipball/7fa47cb5469f07c620fb69dee94b8e1a96943ee2", "url": "https://api.github.com/repos/Chumper/Datatable/zipball/7fa47cb5469f07c620fb69dee94b8e1a96943ee2",
"reference": "7fa47cb5469f07c620fb69dee94b8e1a96943ee2", "reference": "7fa47cb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {

View File

@ -1,6 +1,5 @@
# Invoice Ninja # Invoice Ninja
### [https://www.invoiceninja.com](https://www.invoiceninja.com) ### [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. 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.

View File

@ -137,8 +137,10 @@
<p>&nbsp;</p> <p>&nbsp;</p>
<p>&nbsp;</p> <p>&nbsp;</p>
<!--
<iframe allowTransparency="true" frameborder="0" scrolling="no" src="https://bitnami.com/product/invoice-ninja/widget" style="border:none;width:230px; height:100px;"></iframe> <iframe allowTransparency="true" frameborder="0" scrolling="no" src="https://bitnami.com/product/invoice-ninja/widget" style="border:none;width:230px; height:100px;"></iframe>
-->
</center> </center>
</div> </div>

View File

@ -15,7 +15,7 @@
@endif @endif
@if ($client->trashed()) @if ($client->trashed())
{!! Button::primary(trans('texts.restore_client'), ['onclick' => 'onRestoreClick()']) !!} {!! Button::primary(trans('texts.restore_client'))->withAttributes(['onclick' => 'onRestoreClick()']) !!}
@else @else
{!! DropdownButton::normal(trans('texts.edit_client')) {!! DropdownButton::normal(trans('texts.edit_client'))
->withAttributes(['class'=>'normalDropDown']) ->withAttributes(['class'=>'normalDropDown'])

View File

@ -94,14 +94,12 @@
</thead> </thead>
<tbody> <tbody>
@foreach ($pastDue as $invoice) @foreach ($pastDue as $invoice)
@if (!$invoice->client->trashed())
<tr> <tr>
<td>{!! $invoice->getLink() !!}</td> <td>{!! $invoice->getLink() !!}</td>
<td>{{ $invoice->client->getDisplayName() }}</td> <td>{{ $invoice->client->getDisplayName() }}</td>
<td>{{ Utils::fromSqlDate($invoice->due_date) }}</td> <td>{{ Utils::fromSqlDate($invoice->due_date) }}</td>
<td>{{ Utils::formatMoney($invoice->balance, $invoice->client->currency_id) }}</td> <td>{{ Utils::formatMoney($invoice->balance, $invoice->client->currency_id) }}</td>
</tr> </tr>
@endif
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
@ -123,14 +121,12 @@
</thead> </thead>
<tbody> <tbody>
@foreach ($upcoming as $invoice) @foreach ($upcoming as $invoice)
@if (!$invoice->client->trashed())
<tr> <tr>
<td>{!! $invoice->getLink() !!}</td> <td>{!! $invoice->getLink() !!}</td>
<td>{{ $invoice->client->getDisplayName() }}</td> <td>{{ $invoice->client->getDisplayName() }}</td>
<td>{{ Utils::fromSqlDate($invoice->due_date) }}</td> <td>{{ Utils::fromSqlDate($invoice->due_date) }}</td>
<td>{{ Utils::formatMoney($invoice->balance, $invoice->client->currency_id) }}</td> <td>{{ Utils::formatMoney($invoice->balance, $invoice->client->currency_id) }}</td>
</tr> </tr>
@endif
@endforeach @endforeach
</tbody> </tbody>
</table> </table>