fix accounting model
This commit is contained in:
parent
02bb974a92
commit
1a2eb98d20
@ -49,7 +49,7 @@ class Client(models.Model):
|
||||
desk2_prize_ht = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
|
||||
|
||||
def accounting_for(self, desk_no):
|
||||
return Accounting.objects.filter(location=self.location, client_id=self.id, desk_no=desk_no)[:2][::-1]
|
||||
return Accounting.objects.filter(client_id=self.id, desk_no=desk_no)[:2][::-1]
|
||||
|
||||
def accounting_1(self):
|
||||
return self.accounting_for(1)
|
||||
@ -61,7 +61,7 @@ class Client(models.Model):
|
||||
return str(self.uuid)
|
||||
|
||||
def __unicode__(self):
|
||||
return str(self.location.name)
|
||||
return str(self.client.location.name)
|
||||
|
||||
|
||||
class Accounting(models.Model):
|
||||
@ -72,10 +72,10 @@ class Accounting(models.Model):
|
||||
prize = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.location.name
|
||||
return self.client.location.name
|
||||
|
||||
def __unicode__(self):
|
||||
return self.location.name
|
||||
return self.client.location.name
|
||||
|
||||
class Meta:
|
||||
ordering = ['-time_from']
|
||||
|
Loading…
Reference in New Issue
Block a user