Validation issues for import fixed

This commit is contained in:
EnesSacid-Buker
2023-03-07 15:18:14 +03:00
parent f2b73d83d8
commit d2e96fbe23
27 changed files with 174 additions and 130 deletions

View File

@ -22,9 +22,9 @@ class Tax extends FormRequest
$enabled = 'nullable';
}
$company_id = (int) $this->request->get('company_id');
$company_id = (int) $this->request->get('company_id', company_id());
$type = 'required|string';
$type = 'required|string|in:fixed,normal,inclusive,withholding,compound';
if (!empty($this->request->get('type')) && $this->request->get('type') == 'compound') {
$type .= '|unique:taxes,NULL,' . $id . ',id,company_id,' . $company_id . ',type,compound,deleted_at,NULL';