Settings > Modules) if (!moduleOn('bookkeeping')) { http_response_code(403); echo json_encode(['success' => 'False', 'message' => moduleOffText('bookkeeping')]); exit(); } require_once 'account_map.php'; $update_count = false; $account_id = intval($_POST['account_id'] ?? 0); $before = $account_id ? accountRow($account_id) : null; if ($before) { $error = ''; if (!accountSave(apiFormInput($account_map, $before), $account_id, $error)) { apiFormRefuse($error); } $update_count = 1; $row = accountRow($account_id); $changed = abs(floatval($before['opening_balance']) - floatval($row['opening_balance'])) >= 0.005 ? ', opening balance ' . billingMoney($before['opening_balance'], $row['account_currency_code']) . ' to ' . billingMoney($row['opening_balance'], $row['account_currency_code']) : ''; $name = escapeSql($row['account_name'] . $changed); logAudit("Account", "Edit", "Edited account $name via API ($api_key_name)", 0, $account_id); logAudit("API", "Success", "Edited account $name via API ($api_key_name)", 0); } // Output require_once '../update_output.php';