Skip to content
Snippets Groups Projects
Commit e8ac6567 authored by aspangaro's avatar aspangaro
Browse files

Fix :: Button on/off for account in chart of accounts

parent cfc5bb84
No related branches found
No related tags found
No related merge requests found
...@@ -65,8 +65,7 @@ if ($action == 'delete') { ...@@ -65,8 +65,7 @@ if ($action == 'delete') {
$accounting = new AccountingAccount($db); $accounting = new AccountingAccount($db);
if ($action == 'disable') { if ($action == 'disable') {
$accounting = $accounting->fetch($id); if ($accounting->fetch($id)) {
if (! empty($accounting->id)) {
$result = $accounting->account_desactivate($id); $result = $accounting->account_desactivate($id);
} }
...@@ -75,10 +74,7 @@ if ($action == 'disable') { ...@@ -75,10 +74,7 @@ if ($action == 'disable') {
setEventMessage($accounting->error, 'errors'); setEventMessage($accounting->error, 'errors');
} }
} else if ($action == 'enable') { } else if ($action == 'enable') {
if ($accounting->fetch($id)) {
$accounting = $accounting->fetch($id);
if (! empty($accounting->id)) {
$result = $accounting->account_activate($id); $result = $accounting->account_activate($id);
} }
$action = 'update'; $action = 'update';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment