1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Fix enter expense from client

This commit is contained in:
Hillel Coren 2018-05-08 23:16:35 +03:00
parent 5df2397c1c
commit e34c7ce44e
5 changed files with 5 additions and 8 deletions

View File

@ -117,7 +117,7 @@ class ClientController extends BaseController
}
if ($user->can('create', ENTITY_EXPENSE)) {
$actionLinks[] = ['label' => trans('texts.enter_expense'), 'url' => URL::to('/expenses/create/0/'.$client->public_id)];
$actionLinks[] = ['label' => trans('texts.enter_expense'), 'url' => URL::to('/expenses/create/'.$client->public_id)];
}
$token = $client->getGatewayToken();

View File

@ -141,7 +141,7 @@ class ClientDatatable extends EntityDatatable
[
trans('texts.enter_expense'),
function ($model) {
return URL::to("expenses/create/0/{$model->public_id}");
return URL::to("expenses/create/{$model->public_id}");
},
function ($model) {
return Auth::user()->can('create', ENTITY_EXPENSE);

View File

@ -72,7 +72,7 @@ class VendorDatatable extends EntityDatatable
[
trans('texts.enter_expense'),
function ($model) {
return URL::to("expenses/create/{$model->public_id}");
return URL::to("expenses/create/0/{$model->public_id}");
},
function ($model) {
return Auth::user()->can('create', ENTITY_EXPENSE);

View File

@ -53,7 +53,7 @@
@if ( ! $vendor->trashed())
@can('create', ENTITY_EXPENSE)
{!! Button::primary(trans("texts.new_expense"))
->asLinkTo(URL::to("/expenses/create/{$vendor->public_id}"))
->asLinkTo(URL::to("/expenses/create/0/{$vendor->public_id}"))
->appendIcon(Icon::create('plus-sign')) !!}
@endcan
@endif
@ -203,9 +203,6 @@
$('.normalDropDown:not(.dropdown-toggle)').click(function(event) {
openUrlOnClick('{{ URL::to('vendors/' . $vendor->public_id . '/edit') }}', event)
});
$('.primaryDropDown:not(.dropdown-toggle)').click(function(event) {
openUrlOnClick('{{ URL::to('expenses/create/' . $vendor->public_id ) }}', event);
});
$('.nav-tabs a[href="#expenses"]').tab('show');
});

View File

@ -267,7 +267,7 @@ Route::group(['middleware' => ['lookup:user', 'auth:user']], function () {
// Expense
Route::resource('expenses', 'ExpenseController');
Route::get('expenses/create/{vendor_id?}/{client_id?}/{category_id?}', 'ExpenseController@create');
Route::get('expenses/create/{client_id?}/{vendor_id?}/{category_id?}', 'ExpenseController@create');
Route::get('expenses/{expenses}/clone', 'ExpenseController@cloneExpense');
Route::get('api/expenses', 'ExpenseController@getDatatable');
Route::get('api/vendor_expenses/{id}', 'ExpenseController@getDatatableVendor');