Add total_in_chf utility method

This commit is contained in:
PCoder 2019-04-03 20:29:33 +02:00
parent 147fd0fe5e
commit de3734bf20

View file

@ -325,6 +325,15 @@ class MonthlyHostingBill(AssignPermissionsMixin, models.Model):
instance.assign_permissions(instance.customer.user) instance.assign_permissions(instance.customer.user)
return instance return instance
def total_in_chf(self):
"""
Returns amount in chf. The total amount in this model is in cents.
Hence we multiply it by 0.01 to obtain the result
:return:
"""
return self.total * 0.01
class VMDetail(models.Model): class VMDetail(models.Model):
user = models.ForeignKey(CustomUser) user = models.ForeignKey(CustomUser)