Tax type compound just add once.

This commit is contained in:
Cüneyt Şentürk
2020-12-22 14:47:50 +03:00
parent 1411bd879c
commit 654f7bbb2c
6 changed files with 45 additions and 7 deletions

View File

@ -57,7 +57,13 @@ class Taxes extends Controller
'compound' => trans('taxes.compound'),
];
return view('settings.taxes.create', compact('types'));
$disable_options = [];
if ($compound = Tax::compound()->first()) {
$disable_options = ['compound'];
}
return view('settings.taxes.create', compact('types', 'disable_options'));
}
/**
@ -105,7 +111,13 @@ class Taxes extends Controller
'compound' => trans('taxes.compound'),
];
return view('settings.taxes.edit', compact('tax', 'types'));
$disable_options = [];
if ($tax->type != 'compound' && $compound = Tax::compound()->first()) {
$disable_options = ['compound'];
}
return view('settings.taxes.edit', compact('tax', 'types', 'disable_options'));
}
/**