Apply country specific VAT rates for Generic Products

This commit is contained in:
PCoder 2019-11-15 11:58:15 +05:30
commit 44a20a5029
3 changed files with 22 additions and 6 deletions

View file

@ -82,9 +82,10 @@ class GenericProduct(AssignPermissionsMixin, models.Model):
def __str__(self):
return self.product_name
def get_actual_price(self):
def get_actual_price(self, vat_rate=None):
VAT = vat_rate if vat_rate is not None else self.product_vat
return round(
self.product_price + (self.product_price * self.product_vat), 2
self.product_price + (self.product_price * VAT), 2
)