mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-27 02:12:18 +00:00
Quantize event totals to prevent issues with mixed precision on client authorisation form.
This commit is contained in:
@@ -366,7 +366,7 @@ class Event(models.Model, RevisionMixin):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def vat(self):
|
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
|
Inc VAT
|
||||||
@@ -374,7 +374,7 @@ class Event(models.Model, RevisionMixin):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def total(self):
|
def total(self):
|
||||||
return self.sum_total + self.vat
|
return Decimal(self.sum_total + self.vat).quantize(Decimal('.01'))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cancelled(self):
|
def cancelled(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user