Get periods from line items in invoice detail also
This commit is contained in:
parent
c5f72792d2
commit
c3842a5ed5
2 changed files with 25 additions and 3 deletions
|
|
@ -391,6 +391,28 @@ class MonthlyHostingBill(AssignPermissionsMixin, models.Model):
|
|||
logger.debug("VM_IDS=".format(','.join(vm_ids)))
|
||||
return return_value
|
||||
|
||||
def get_period_start(self):
|
||||
"""
|
||||
Return the period start of the invoice for the line items
|
||||
:return:
|
||||
"""
|
||||
items = HostingBillLineItem.objects.filter(monthly_hosting_bill=self)
|
||||
if len(items) > 0:
|
||||
return items[0].period_start
|
||||
else:
|
||||
return self.period_start
|
||||
|
||||
def get_period_end(self):
|
||||
"""
|
||||
Return the period end of the invoice for the line items
|
||||
:return:
|
||||
"""
|
||||
items = HostingBillLineItem.objects.filter(monthly_hosting_bill=self)
|
||||
if len(items) > 0:
|
||||
return items[0].period_end
|
||||
else:
|
||||
return self.period_end
|
||||
|
||||
|
||||
class HostingBillLineItem(AssignPermissionsMixin, models.Model):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue