mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
support: Show annual revenue for active fixed price plans.
In the activity and support views, we want to see the annual revenue for fixed price plans. While on billing pages, we do not display this information as these plans are renegotiated annually. Adds get_annual_recurring_revenue_for_support_data function to BillingSession class, so that we can get the fixed price plan data for these views without changing the logic for what is displayed on the billing pages.
This commit is contained in:
committed by
Tim Abbott
parent
3b73f19719
commit
4fcf7945b0
@@ -191,18 +191,15 @@ def get_remote_activity_plan_data(
|
||||
elif remote_realm is not None:
|
||||
renewal_cents = RemoteRealmBillingSession(
|
||||
remote_realm=remote_realm
|
||||
).get_customer_plan_renewal_amount(plan, license_ledger)
|
||||
).get_annual_recurring_revenue_for_support_data(plan, license_ledger)
|
||||
current_rate = get_plan_rate_percentage(plan.discount)
|
||||
else:
|
||||
assert remote_server is not None
|
||||
renewal_cents = RemoteServerBillingSession(
|
||||
remote_server=remote_server
|
||||
).get_customer_plan_renewal_amount(plan, license_ledger)
|
||||
).get_annual_recurring_revenue_for_support_data(plan, license_ledger)
|
||||
current_rate = get_plan_rate_percentage(plan.discount)
|
||||
|
||||
if plan.billing_schedule == CustomerPlan.BILLING_SCHEDULE_MONTHLY:
|
||||
renewal_cents *= 12
|
||||
|
||||
return RemoteActivityPlanData(
|
||||
current_status=plan.get_plan_status_as_text(),
|
||||
current_plan_name=plan.name,
|
||||
@@ -238,9 +235,7 @@ def get_estimated_arr_and_rate_by_realm() -> Tuple[Dict[str, int], Dict[str, str
|
||||
assert latest_ledger_entry is not None
|
||||
renewal_cents = RealmBillingSession(
|
||||
realm=plan.customer.realm
|
||||
).get_customer_plan_renewal_amount(plan, latest_ledger_entry)
|
||||
if plan.billing_schedule == CustomerPlan.BILLING_SCHEDULE_MONTHLY:
|
||||
renewal_cents *= 12
|
||||
).get_annual_recurring_revenue_for_support_data(plan, latest_ledger_entry)
|
||||
annual_revenue[plan.customer.realm.string_id] = renewal_cents
|
||||
plan_rate[plan.customer.realm.string_id] = get_plan_rate_percentage(plan.discount)
|
||||
return annual_revenue, plan_rate
|
||||
|
||||
Reference in New Issue
Block a user