fix access to accounting data

This commit is contained in:
Robert Einsle 2017-02-02 20:43:32 +01:00
parent 16243def6d
commit e0c090dad9

View File

@ -47,7 +47,7 @@ class Client(models.Model):
desk2_prize_ht = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True) desk2_prize_ht = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
def accounting_for(self, desk_no): def accounting_for(self, desk_no):
return Accounting.objects.filter(location=self.location, desk_no=desk_no)[:2][::-1] return Accounting.objects.filter(location=self.location, client_id=self.id, desk_no=desk_no)[:2][::-1]
def accounting_1(self): def accounting_1(self):
return self.accounting_for(1) return self.accounting_for(1)