mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Fixes for expense category validation
This commit is contained in:
parent
4f06bd116b
commit
0dc9129e76
@ -45,6 +45,8 @@ class StoreExpenseRequest extends Request
|
||||
$rules['client_id'] = 'bail|sometimes|exists:clients,id,company_id,'.auth()->user()->company()->id;
|
||||
}
|
||||
|
||||
$rules['category_id'] = 'bail|nullable|sometimes|exists:expense_categories,id,company_id,'.auth()->user()->company()->id.',is_deleted,0';
|
||||
|
||||
return $this->globalRules($rules);
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,8 @@ class UpdateExpenseRequest extends Request
|
||||
$rules['number'] = Rule::unique('expenses')->where('company_id', auth()->user()->company()->id)->ignore($this->expense->id);
|
||||
}
|
||||
|
||||
$rules['category_id'] = 'bail|sometimes|nullable|exists:expense_categories,id,company_id,'.auth()->user()->company()->id.',is_deleted,0';
|
||||
|
||||
return $this->globalRules($rules);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user