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:
parent
5df2397c1c
commit
e34c7ce44e
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
5
resources/views/vendors/show.blade.php
vendored
5
resources/views/vendors/show.blade.php
vendored
@ -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');
|
||||
});
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user