mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
stripe: Update next_invoice_date for current logic of monthly invoices.
Updates next_invoice_date since, as of commit caba57fe1e
, we no
longer consider the plan's billing schedule (annual or monthly)
when invoicing for additional licenses.
This commit is contained in:
committed by
Tim Abbott
parent
661e5c284e
commit
a0562593b3
@@ -310,13 +310,12 @@ def next_invoice_date(plan: CustomerPlan) -> datetime | None:
|
||||
if plan.status == CustomerPlan.ENDED:
|
||||
return None
|
||||
assert plan.next_invoice_date is not None # for mypy
|
||||
months_per_period = 1
|
||||
periods = 1
|
||||
dt = plan.billing_cycle_anchor
|
||||
while dt <= plan.next_invoice_date:
|
||||
dt = add_months(plan.billing_cycle_anchor, months_per_period * periods)
|
||||
periods += 1
|
||||
return dt
|
||||
months = 1
|
||||
candidate_invoice_date = plan.billing_cycle_anchor
|
||||
while candidate_invoice_date <= plan.next_invoice_date:
|
||||
candidate_invoice_date = add_months(plan.billing_cycle_anchor, months)
|
||||
months += 1
|
||||
return candidate_invoice_date
|
||||
|
||||
|
||||
def get_amount_to_credit_for_plan_tier_change(
|
||||
|
Reference in New Issue
Block a user