mirror of https://github.com/zulip/zulip.git
billing: Show breakdown of renewal amount if not fixed_price.
This commit is contained in:
parent
17573cd1fb
commit
2997c269e1
|
@ -187,6 +187,21 @@ def billing_home(
|
||||||
else:
|
else:
|
||||||
payment_method = "Billed by invoice"
|
payment_method = "Billed by invoice"
|
||||||
|
|
||||||
|
fixed_price = (
|
||||||
|
cents_to_dollar_string(plan.fixed_price) if plan.fixed_price is not None else None
|
||||||
|
)
|
||||||
|
|
||||||
|
billing_frequency = CustomerPlan.BILLING_SCHEDULES[plan.billing_schedule]
|
||||||
|
price_per_license_int = plan.price_per_license
|
||||||
|
if price_per_license_int is not None and billing_frequency == "Annual":
|
||||||
|
price_per_license_int = int(price_per_license_int / 12)
|
||||||
|
|
||||||
|
price_per_license = (
|
||||||
|
cents_to_dollar_string(price_per_license_int)
|
||||||
|
if price_per_license_int is not None
|
||||||
|
else None
|
||||||
|
)
|
||||||
|
|
||||||
context.update(
|
context.update(
|
||||||
plan_name=plan.name,
|
plan_name=plan.name,
|
||||||
has_active_plan=True,
|
has_active_plan=True,
|
||||||
|
@ -204,7 +219,9 @@ def billing_home(
|
||||||
stripe_email=stripe_customer.email,
|
stripe_email=stripe_customer.email,
|
||||||
CustomerPlan=CustomerPlan,
|
CustomerPlan=CustomerPlan,
|
||||||
onboarding=onboarding,
|
onboarding=onboarding,
|
||||||
billing_frequency=CustomerPlan.BILLING_SCHEDULES[plan.billing_schedule],
|
billing_frequency=billing_frequency,
|
||||||
|
fixed_price=fixed_price,
|
||||||
|
price_per_license=price_per_license,
|
||||||
)
|
)
|
||||||
|
|
||||||
return render(request, "corporate/billing.html", context=context)
|
return render(request, "corporate/billing.html", context=context)
|
||||||
|
|
|
@ -129,6 +129,9 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<br />
|
<br />
|
||||||
Expected charge: <strong>${{ renewal_amount }}</strong>
|
Expected charge: <strong>${{ renewal_amount }}</strong>
|
||||||
|
{% if not fixed_price %}
|
||||||
|
(${{ price_per_license }} x {{ licenses_at_next_renewal }} {{ 'user' if licenses_at_next_renewal == 1 else 'users' }} x {{ "1 month" if billing_frequency == "Monthly" else "12 months" }})
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
Your plan ends on <strong>{{ renewal_date }}</strong>, and does not renew.
|
Your plan ends on <strong>{{ renewal_date }}</strong>, and does not renew.
|
||||||
|
|
Loading…
Reference in New Issue