Settings > Modules) if (!moduleOn('bookkeeping')) { http_response_code(403); echo json_encode(['success' => 'False', 'message' => moduleOffText('bookkeeping')]); exit(); } $account_id = intval($_GET['account_id'] ?? 0); $rows = []; foreach (accountsList($account_id ? null : (!empty($_GET['archived']) ? null : false)) as $id => $row) { if ($account_id && $id !== $account_id) { continue; } $rows[] = [ 'account_id' => $id, 'account_name' => $row['account_name'], 'account_type' => intval($row['account_type']), 'account_currency_code' => $row['account_currency_code'], 'opening_balance' => round(floatval($row['opening_balance']), 2), 'balance' => $row['balance'], 'account_description' => $row['account_description'], 'account_notes' => $row['account_notes'], 'account_created_at' => $row['account_created_at'], 'account_archived_at' => $row['account_archived_at'], ]; } if ($rows) { echo json_encode(['success' => 'True', 'count' => count($rows), 'data' => $rows]); exit(); } $sql = false; // Output require_once "../read_output.php";