Improve billing address testing

This commit is contained in:
Nico Schottelius 2020-08-08 23:02:24 +02:00
commit fd39526350
2 changed files with 104 additions and 13 deletions

View file

@ -422,6 +422,7 @@ class Bill(models.Model):
ending_date = end_of_month(starting_date)
# FIXME above: maybe even use different date / active / open bill
bill, created = cls.objects.get_or_create(
owner=owner,
starting_date=starting_date,
@ -438,8 +439,13 @@ class Bill(models.Model):
starting_date=starting_date,
ending_date=ending_date)
# Bill all active, recurring orders
#if order.
else:
# Bill all recurring orders -- filter in the next iteration :-)
br = BillRecord.objects.create(bill=bill,
order=order,
starting_date=starting_date,
ending_date=ending_date)
return bill
@ -450,8 +456,7 @@ class Bill(models.Model):
# maxtime = time of last order
# iterate month based through it
cls.assign_orders_to_bill(owner, year, month)
pass
cls.create_next_bill_for_user(owner)
def assign_orders_to_bill(self, owner, year, month):
"""