Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
corporate: Fix next payment info on billing page for fixed-price plans.
Prakhar Pratyush24f902f3c6fd
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.pyindex b0093600876..ae324c2e92b 100644--- a/corporate/lib/stripe.py+++ b/corporate/lib/stripe.py@@ -2164,6 +2164,8 @@ class BillingSession(ABC):last_ledger_entry: LicenseLedger,) -> int:if plan.fixed_price is not None:+ if plan.end_date == self.get_next_billing_cycle(plan):+ return 0return get_amount_due_fixed_price_plan(plan.fixed_price, plan.billing_schedule)if last_ledger_entry.licenses_at_next_renewal is None:return 0 # nocoveragediff --git a/corporate/tests/test_activity_views.py b/corporate/tests/test_activity_views.pyindex e93fc20cf1a..cb066bd87f0 100644--- a/corporate/tests/test_activity_views.py+++ b/corporate/tests/test_activity_views.py@@ -367,6 +367,6 @@ class ActivityTest(ZulipTestCase):add_audit_log_data(realm.server, remote_realm=realm, realm_id=None)self.login("iago")- with self.assert_database_query_count(11):+ with self.assert_database_query_count(12):result = self.client_get("/activity/remote")self.assertEqual(result.status_code, 200)diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.pyindex 019b404649b..62bbd13ae16 100644--- a/corporate/tests/test_stripe.py+++ b/corporate/tests/test_stripe.py@@ -6702,8 +6702,8 @@ class TestRemoteRealmBillingFlow(StripeTestCase, RemoteRealmBillingTestCase):"Annual","March 2, 2013","This is a fixed-price plan",- "Your plan will automatically renew on",- f"${annual_fixed_price:,.2f}",+ "Your plan ends on <strong>March 2, 2013</strong>",+ "You will be contacted by Zulip Sales","Visa ending in 4242","Update card",]:@@ -8397,8 +8397,8 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase):"Annual","March 2, 2013","This is a fixed-price plan",- "Your plan will automatically renew on",- f"${annual_fixed_price:,.2f}",+ "Your plan ends on <strong>March 2, 2013</strong>",+ "You will be contacted by Zulip Sales","Visa ending in 4242","Update card",]:diff --git a/templates/corporate/billing/billing.html b/templates/corporate/billing/billing.htmlindex b9c261a964a..62156fd6a01 100644--- a/templates/corporate/billing/billing.html+++ b/templates/corporate/billing/billing.html@@ -272,6 +272,9 @@<i>Minimum purchase for this plan: {{ min_licenses_for_plan }} licenses</i>{% endif %}{% endif %}+ {% elif fixed_price_plan %}+ This is a fixed-price plan. Your plan ends on <strong>{{ renewal_date }}</strong>.+ You will be contacted by Zulip Sales a couple of months before <strong>{{renewal_date}}</strong> to discuss plan renewal.{% else %}Your plan ends on <strong>{{ renewal_date }}</strong>, and does not renew.{% endif %}