mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	[note] Added type property to transactions
This commit is contained in:
		
				
					committed by
					
						
						Bombar Maxime
					
				
			
			
				
	
			
			
			
						parent
						
							5d15b8c613
						
					
				
				
					commit
					49952355e6
				
			@@ -157,6 +157,10 @@ class Transaction(PolymorphicModel):
 | 
			
		||||
    def total(self):
 | 
			
		||||
        return self.amount * self.quantity
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def type(self):
 | 
			
		||||
        return _('transfert')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class TemplateTransaction(Transaction):
 | 
			
		||||
    """
 | 
			
		||||
@@ -174,6 +178,10 @@ class TemplateTransaction(Transaction):
 | 
			
		||||
        on_delete=models.PROTECT,
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def type(self):
 | 
			
		||||
        return _('template')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class MembershipTransaction(Transaction):
 | 
			
		||||
    """
 | 
			
		||||
@@ -190,3 +198,7 @@ class MembershipTransaction(Transaction):
 | 
			
		||||
    class Meta:
 | 
			
		||||
        verbose_name = _("membership transaction")
 | 
			
		||||
        verbose_name_plural = _("membership transactions")
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def type(self):
 | 
			
		||||
        return _('membership')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user