Fixed issue #363
This commit is contained in:
parent
a69807c488
commit
5ebe171117
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue