Don't choke on reimbursement claims with fractional units

This commit is contained in:
Yingtong Li 2020-10-05 00:11:12 +11:00
parent 066b461769
commit 2dde94483f
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -240,7 +240,7 @@ class ReimbursementClaim(models.Model):
def get_total(self): def get_total(self):
total = Decimal(0) total = Decimal(0)
for item in self.items: for item in self.items:
total += Decimal(item['Unit price']) * item['Units'] total += Decimal(item['Unit price']) * Decimal(item['Units'])
return total return total
def update_state(self, user, state): def update_state(self, user, state):