Merge pull request #1742 from cuneytsenturk/master

Add Document/Transaction/Contact types to the config vol 2
This commit is contained in:
Cüneyt Şentürk
2021-01-12 00:28:19 +03:00
committed by GitHub
26 changed files with 1456 additions and 1093 deletions

View File

@ -14,7 +14,7 @@ class Advanced extends Component
*/
public function render()
{
$category_type = $this->getCategoryType();
$category_type = $this->categoryType;
if ($category_type) {
$categories = Category::$category_type()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id');
@ -24,31 +24,4 @@ class Advanced extends Component
return view('components.documents.form.advanced', compact('categories', 'category_type'));
}
protected function getCategoryType()
{
$type = '';
switch ($this->type) {
case 'bill':
case 'expense':
case 'purchase':
$type = 'expense';
break;
case 'item':
$type = 'item';
break;
case 'other':
$type = 'other';
break;
case 'transfer':
$type = 'transfer';
break;
default:
$type = 'income';
break;
}
return $type;
}
}

View File

@ -16,7 +16,7 @@ class Company extends Component
{
$company = user()->companies()->first();
$inputNameType = config("type.{$this->type}.route_parameter");
$inputNameType = config('type.' . $this->type . '.route.parameter');
return view('components.documents.form.company', compact('company','inputNameType'));
}