mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
populate_billing_realms: Simulate 2 months free trial.
Makes the billing page for realms on free trial more realistic.
This commit is contained in:
@@ -271,10 +271,14 @@ def add_card_to_customer(customer: Customer) -> None:
|
||||
|
||||
def create_plan_for_customer(customer: Customer, customer_profile: CustomerProfile) -> None:
|
||||
assert customer_profile.tier is not None
|
||||
months = 12
|
||||
if customer_profile.billing_schedule == CustomerPlan.BILLING_SCHEDULE_MONTHLY:
|
||||
months = 1
|
||||
next_invoice_date = add_months(timezone_now(), months)
|
||||
if customer_profile.status == CustomerPlan.FREE_TRIAL:
|
||||
# 2 months free trial.
|
||||
next_invoice_date = add_months(timezone_now(), 2)
|
||||
else:
|
||||
months = 12
|
||||
if customer_profile.billing_schedule == CustomerPlan.BILLING_SCHEDULE_MONTHLY:
|
||||
months = 1
|
||||
next_invoice_date = add_months(timezone_now(), months)
|
||||
|
||||
customer_plan = CustomerPlan.objects.create(
|
||||
customer=customer,
|
||||
|
||||
Reference in New Issue
Block a user