Merge pull request #1944 from aspangaro/develop-accounting
Fix :: Button on/off for account in chart of accounts
This commit is contained in:
commit
13090ed778
@ -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';
|
||||
|
||||
@ -227,9 +227,8 @@ if ($result) {
|
||||
$i ++;
|
||||
}
|
||||
|
||||
print '<tr><td colspan="8"> </td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
|
||||
@ -208,10 +208,8 @@ if ($result) {
|
||||
$i ++;
|
||||
}
|
||||
|
||||
print '<tr><td colspan="8"> </td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventiler") . '"></td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</table>';
|
||||
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user