Commit 45bbadd9 authored by Michal Čihař's avatar Michal Čihař

Check for not paid billings

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 0671b9b9
......@@ -19,6 +19,7 @@
#
from django.core.management.base import BaseCommand
from django.utils import timezone
from weblate.billing.models import Billing
......@@ -38,3 +39,12 @@ class Command(BaseCommand):
self.stdout.write(
' * {0}'.format(bill)
)
header = False
for bill in Billing.objects.filter(state=Billing.STATE_ACTIVE):
if not bill.invoice_set.filter(end__gt=timezone.now()).exists():
if not header:
self.stdout.write('Following billings are past due date:')
header = True
self.stdout.write(
' * {0}'.format(bill)
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment