mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Support creating inline vendors and categories
This commit is contained in:
parent
a3b359f062
commit
1ac32c13a7
@ -30,7 +30,7 @@ class ExpenseRequest extends EntityRequest
|
||||
&& $this->user()->can('create', ENTITY_EXPENSE_CATEGORY))
|
||||
{
|
||||
$category = app('App\Ninja\Repositories\ExpenseCategoryRepository')->save([
|
||||
'name' => $this->expense_category_name,
|
||||
'name' => trim($this->expense_category_name),
|
||||
]);
|
||||
$input['expense_category_id'] = $category->id;
|
||||
} elseif ($this->expense_category_id) {
|
||||
@ -43,7 +43,7 @@ class ExpenseRequest extends EntityRequest
|
||||
&& $this->user()->can('create', ENTITY_VENDOR))
|
||||
{
|
||||
$vendor = app('App\Ninja\Repositories\VendorRepository')->save([
|
||||
'name' => $this->vendor_name,
|
||||
'name' => trim($this->vendor_name),
|
||||
]);
|
||||
// TODO change to private id once service is refactored
|
||||
$input['vendor_id'] = $vendor->public_id;
|
||||
|
@ -18,7 +18,7 @@ class TaskRequest extends EntityRequest
|
||||
&& $this->user()->can('create', ENTITY_PROJECT))
|
||||
{
|
||||
$project = app('App\Ninja\Repositories\ProjectRepository')->save([
|
||||
'name' => $this->project_name,
|
||||
'name' => trim($this->project_name),
|
||||
'client_id' => Client::getPrivateId($this->client),
|
||||
]);
|
||||
$input['project_id'] = $project->public_id;
|
||||
|
Loading…
Reference in New Issue
Block a user