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); $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') {
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';

View File

@ -227,9 +227,8 @@ if ($result) {
$i ++; $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 '</table>';
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
print '</form>'; print '</form>';
} else { } else {
print $db->error(); print $db->error();

View File

@ -208,10 +208,8 @@ if ($result) {
$i ++; $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 '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
print "</table>";
print '</form>'; print '</form>';
} else { } else {
print $db->error(); print $db->error();