support: Format ARR column as dollar amount in remote activity view.

This commit is contained in:
Lauryn Menard 2023-12-19 12:55:08 +01:00 committed by Tim Abbott
parent ad8daffb62
commit f56923fafa
2 changed files with 5 additions and 3 deletions

View File

@ -11,6 +11,7 @@ from analytics.views.activity_common import (
remote_installation_support_link,
)
from corporate.lib.analytics import get_plan_data_by_remote_server
from corporate.lib.stripe import cents_to_dollar_string
from zerver.decorator import require_server_admin
from zilencer.models import get_remote_server_guest_and_non_guest_count
@ -105,9 +106,10 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse:
row.append("---")
row.append("---")
else:
revenue = cents_to_dollar_string(server_plan_data.annual_revenue)
row.append(server_plan_data.current_plan_name)
row.append(server_plan_data.current_status)
row.append(server_plan_data.annual_revenue)
row.append(f"${revenue}")
# Add user counts
remote_server_counts = get_remote_server_guest_and_non_guest_count(row[0])
row.append(remote_server_counts.non_guest_user_count)

View File

@ -83,12 +83,12 @@ def get_plan_data_by_remote_server() -> Dict[int, RemoteActivityPlanData]: # no
remote_server_plan_data[server_id] = RemoteActivityPlanData(
current_status="Multiple plans",
current_plan_name="See support view",
annual_revenue=current_revenue + int(renewal_cents / 100),
annual_revenue=current_revenue + renewal_cents,
)
else:
remote_server_plan_data[server_id] = RemoteActivityPlanData(
current_status=plan.get_plan_status_as_text(),
current_plan_name=plan.name,
annual_revenue=int(renewal_cents / 100),
annual_revenue=renewal_cents,
)
return remote_server_plan_data