Convert VAT rate to decimal to be consistent
This commit is contained in:
parent
76c2b9d16c
commit
582e952187
1 changed files with 2 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import decimal
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -83,7 +84,7 @@ class GenericProduct(AssignPermissionsMixin, models.Model):
|
||||||
return self.product_name
|
return self.product_name
|
||||||
|
|
||||||
def get_actual_price(self, vat_rate=None):
|
def get_actual_price(self, vat_rate=None):
|
||||||
VAT = vat_rate if vat_rate is not None else self.product_vat
|
VAT = decimal.Decimal(vat_rate) if vat_rate is not None else self.product_vat
|
||||||
return round(
|
return round(
|
||||||
self.product_price + (self.product_price * VAT), 2
|
self.product_price + (self.product_price * VAT), 2
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue