forked from uncloud/uncloud
Fix tests for billing
This commit is contained in:
parent
89519e48a9
commit
6a928a2b2a
2 changed files with 12 additions and 4 deletions
|
|
@ -327,7 +327,7 @@ class Order(models.Model):
|
|||
One time orders have a recurring period of 0, so this work universally
|
||||
"""
|
||||
|
||||
return self.starting_date + timedelta(seconds=self.recurring_period)
|
||||
return self.starting_date + datetime.timedelta(seconds=self.recurring_period)
|
||||
|
||||
|
||||
@property
|
||||
|
|
@ -438,7 +438,7 @@ class Bill(models.Model):
|
|||
starting_date = last_bill.starting_date
|
||||
ending_date = bill.ending_date
|
||||
else:
|
||||
starting_date = last_bill.end_date + datetime.timedelta(seconds=1)
|
||||
starting_date = last_bill.ending_date + datetime.timedelta(seconds=1)
|
||||
else:
|
||||
if first_order:
|
||||
starting_date = first_order.starting_date
|
||||
|
|
@ -566,6 +566,13 @@ class Bill(models.Model):
|
|||
# For each recurring order get the usage and bill it
|
||||
|
||||
|
||||
def close(self):
|
||||
"""
|
||||
Close/finish a bill
|
||||
"""
|
||||
|
||||
self.is_final = True
|
||||
self.save()
|
||||
|
||||
class BillRecord(models.Model):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue