From 2dde94483fec22691530fb126ae9f54f9c3b7699 Mon Sep 17 00:00:00 2001 From: Yingtong Li Date: Mon, 5 Oct 2020 00:11:12 +1100 Subject: [PATCH] Don't choke on reimbursement claims with fractional units --- sstreasury/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sstreasury/models.py b/sstreasury/models.py index 02f2a01..f278dff 100644 --- a/sstreasury/models.py +++ b/sstreasury/models.py @@ -240,7 +240,7 @@ class ReimbursementClaim(models.Model): def get_total(self): total = Decimal(0) for item in self.items: - total += Decimal(item['Unit price']) * item['Units'] + total += Decimal(item['Unit price']) * Decimal(item['Units']) return total def update_state(self, user, state):