mirror of https://github.com/zulip/zulip.git
support: Format ARR column as dollar amount in remote activity view.
This commit is contained in:
parent
ad8daffb62
commit
f56923fafa
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue