* fixed discout calculation

This commit is contained in:
Phil Zhitnikov 2023-07-07 08:33:17 +04:00
parent fc2297b17c
commit 6676eaed0e

View File

@ -356,7 +356,7 @@ class Checklist(models.Model):
# We assume that working promocode was bound correctly through serializer
# and intentionally don't check if promocode is active here
promocode = self.promocode
price -= promocode.discount * self.price_rub
price -= promocode.discount * self.price_rub / 100
free_delivery = promocode.free_delivery
no_comission = promocode.no_comission
@ -367,7 +367,7 @@ class Checklist(models.Model):
if not no_comission:
price += self.commission_rub
return price
return Decimal.max(Decimal(0), price)
@property
def delivery_price_CN_RU(self) -> Decimal: