Process prices as floats

This commit is contained in:
PCoder 2019-11-15 12:39:03 +05:30
parent d399fe6e79
commit 940eaf3a07

View file

@ -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
)