Quantize event totals to prevent issues with mixed precision on client authorisation form.

This commit is contained in:
Tom Price
2017-04-19 15:27:12 +01:00
parent 56d4e438b6
commit d9076a4f5f

View File

@@ -366,7 +366,7 @@ class Event(models.Model, RevisionMixin):
@property
def vat(self):
return self.sum_total * self.vat_rate.rate
return Decimal(self.sum_total * self.vat_rate.rate).quantize(Decimal('.01'))
"""
Inc VAT
@@ -374,7 +374,7 @@ class Event(models.Model, RevisionMixin):
@property
def total(self):
return self.sum_total + self.vat
return Decimal(self.sum_total + self.vat).quantize(Decimal('.01'))
@property
def cancelled(self):