fix accounting
This commit is contained in:
parent
24a8099b83
commit
3c500baf99
@ -56,11 +56,12 @@ class Client(models.Model):
|
|||||||
|
|
||||||
def accounting_for(self, desk_no, pht, pnt):
|
def accounting_for(self, desk_no, pht, pnt):
|
||||||
t = Accounting.objects.filter(client_id=self.id, desk_no=desk_no)[:3][::-1]
|
t = Accounting.objects.filter(client_id=self.id, desk_no=desk_no)[:3][::-1]
|
||||||
a = t[t.__len__() - 1]
|
if t.__len__() > 0:
|
||||||
if a.time_to is None:
|
a = t[t.__len__() - 1]
|
||||||
prize = utils.get_prize_for(start=a.time_from, end=datetime.now(timezone.utc), pph=pht)
|
if a.time_to is None:
|
||||||
if prize != a.prize:
|
prize = utils.get_prize_for(start=a.time_from, end=datetime.now(timezone.utc), pph=pht)
|
||||||
a.prize = prize
|
if prize != a.prize:
|
||||||
|
a.prize = prize
|
||||||
return t
|
return t
|
||||||
|
|
||||||
def accounting_1(self):
|
def accounting_1(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user