Process prices as floats
This commit is contained in:
parent
d399fe6e79
commit
940eaf3a07
1 changed files with 2 additions and 2 deletions
|
@ -84,9 +84,9 @@ class GenericProduct(AssignPermissionsMixin, models.Model):
|
|||
return self.product_name
|
||||
|
||||
def get_actual_price(self, vat_rate=None):
|
||||
VAT = decimal.Decimal(vat_rate) if vat_rate is not None else self.product_vat
|
||||
VAT = vat_rate if vat_rate is not None else self.product_vat
|
||||
return round(
|
||||
self.product_price + (self.product_price * VAT), 2
|
||||
float(self.product_price) + float(self.product_price * VAT), 2
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue