first bill generation works

Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
Nico Schottelius 2020-08-09 00:37:27 +02:00
commit d7c0c40926
6 changed files with 136 additions and 65 deletions

View file

@ -5,8 +5,8 @@ from django.utils import timezone
from datetime import datetime, timedelta
from uncloud_pay.models import *
#import opennebula.models as one
from uncloud_vm.models import *
import sys
def vm_price_2020(cpu=1, ram=2, v6only=False):
@ -35,6 +35,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
user = get_user_model().objects.get(username=options['username'])
addr, created = BillingAddress.objects.get_or_create(
owner=user,
active=True,
@ -72,6 +73,8 @@ class Command(BaseCommand):
vm25206.save()
vm25206.create_or_update_order(when_to_start=timezone.make_aware(datetime.datetime(2020,4,17)))
Bill.create_next_bill_for_user(user)
sys.exit(0)