2019-04-26 13:15:11 +02:00
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
from django.conf import settings
|
2023-10-12 19:43:45 +02:00
|
|
|
from typing_extensions import override
|
2019-04-26 13:15:11 +02:00
|
|
|
|
|
|
|
from zerver.lib.management import ZulipBaseCommand
|
2020-01-14 21:59:46 +01:00
|
|
|
|
2019-04-26 13:15:11 +02:00
|
|
|
if settings.BILLING_ENABLED:
|
|
|
|
from corporate.lib.stripe import invoice_plans_as_needed
|
|
|
|
|
2021-02-12 08:19:30 +01:00
|
|
|
|
2019-04-26 13:15:11 +02:00
|
|
|
class Command(ZulipBaseCommand):
|
|
|
|
help = """Generates invoices for customers if needed."""
|
|
|
|
|
2023-10-12 19:43:45 +02:00
|
|
|
@override
|
2019-04-26 13:15:11 +02:00
|
|
|
def handle(self, *args: Any, **options: Any) -> None:
|
|
|
|
if settings.BILLING_ENABLED:
|
|
|
|
invoice_plans_as_needed()
|