Merge pull request #1944 from aspangaro/develop-accounting

Fix :: Button on/off for account in chart of accounts
This commit is contained in:
Laurent Destailleur 2014-10-12 01:38:40 +02:00
commit 13090ed778
3 changed files with 5 additions and 12 deletions

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';

View File

@ -227,9 +227,8 @@ if ($result) {
$i ++;
}
print '<tr><td colspan="8">&nbsp;</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();

View File

@ -208,10 +208,8 @@ if ($result) {
$i ++;
}
print '<tr><td colspan="8">&nbsp;</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();