Prices are with VAT, turning the calculation around.

This commit is contained in:
Víðir Valberg Guðmundsson 2016-05-16 16:14:16 +02:00
parent 9eefc6bdfd
commit bee6a65ede
1 changed files with 8 additions and 8 deletions

View File

@ -72,6 +72,14 @@ class Order(CreatedUpdatedModel):
@property
def subtotal(self):
return self.total - self.vat
@property
def vat(self):
return (self.total/100)*25
@property
def total(self):
return self.products.aggregate(
sum=Sum(
models.F('orderproductrelation__product__price') *
@ -80,14 +88,6 @@ class Order(CreatedUpdatedModel):
)
)['sum']
@property
def vat(self):
return (self.subtotal/100)*25
@property
def total(self):
return self.subtotal + self.vat
class ProductCategory(CreatedUpdatedModel, UUIDModel):
class Meta: