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

This commit is contained in:
aspangaro 2014-10-07 20:50:57 +02:00
parent cfc5bb845a
commit e8ac6567b7

View File

@ -65,8 +65,7 @@ if ($action == 'delete') {
$accounting = new AccountingAccount($db);
if ($action == 'disable') {
$accounting = $accounting->fetch($id);
if (! empty($accounting->id)) {
if ($accounting->fetch($id)) {
$result = $accounting->account_desactivate($id);
}
@ -75,10 +74,7 @@ if ($action == 'disable') {
setEventMessage($accounting->error, 'errors');
}
} else if ($action == 'enable') {
$accounting = $accounting->fetch($id);
if (! empty($accounting->id)) {
if ($accounting->fetch($id)) {
$result = $accounting->account_activate($id);
}
$action = 'update';