Fixed issue #363

This commit is contained in:
Prashant Singh 2018-12-21 14:18:59 +05:30
parent a69807c488
commit 5ebe171117
2 changed files with 16 additions and 12 deletions

View File

@ -144,14 +144,14 @@ class TaxCategoryController extends Controller
]);
$data = request()->input();
$taxCategory = $this->taxCategory->update($data, $id);
if(!$taxCategory) {
session()->flash('error', trans('admin::app.settings.tax-categories.update-error'));
return redirect()->back();
}
$taxRates = $data['taxrates'];
//attach the categories in the tax map table
@ -170,12 +170,10 @@ class TaxCategoryController extends Controller
*/
public function destroy($id)
{
if($this->taxCategory->count() == 1) {
session()->flash('error', trans('admin::app.settings.tax-categories.atleast-one'));
} else {
try {
$this->taxCategory->delete($id);
session()->flash('success', trans('admin::app.settings.tax-categories.delete'));
} catch(Exception $e) {
return redirect()->back();
}
return redirect()->back();

View File

@ -157,12 +157,18 @@ class TaxRateController extends Controller
*/
public function destroy($id)
{
if($this->taxRate->count() == 1) {
session()->flash('error', trans('admin::app.settings.tax-rates.atleast-one'));
} else {
$this->taxRate->delete($id);
// if($this->taxRate->count() == 1) {
// session()->flash('error', trans('admin::app.settings.tax-rates.atleast-one'));
// } else {
session()->flash('success', trans('admin::app.settings.tax-rates.delete'));
// session()->flash('success', trans('admin::app.settings.tax-rates.delete'));
// }
try{
$this->taxRate->delete($id);
} catch(Exception $e) {
return redirect()->back();
}
return redirect()->back();