Prices are with VAT, turning the calculation around.
This commit is contained in:
parent
9eefc6bdfd
commit
bee6a65ede
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue