Add total_in_chf utility method
This commit is contained in:
		
					parent
					
						
							
								147fd0fe5e
							
						
					
				
			
			
				commit
				
					
						de3734bf20
					
				
			
		
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -325,6 +325,15 @@ class MonthlyHostingBill(AssignPermissionsMixin, models.Model):
 | 
			
		|||
        instance.assign_permissions(instance.customer.user)
 | 
			
		||||
        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):
 | 
			
		||||
    user = models.ForeignKey(CustomUser)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue