* Updated commission logic
This commit is contained in:
parent
0dcc98ab70
commit
0bb89fc6f0
|
|
@ -459,14 +459,14 @@ class Checklist(models.Model):
|
|||
if self.price_snapshot_id:
|
||||
return self.price_snapshot.commission_rub
|
||||
|
||||
commission = (self.price_rub * Decimal(settings.COMMISSION_OVER_150K)
|
||||
if self.price_rub > 150_000
|
||||
else GlobalSettings.load().commission_rub)
|
||||
|
||||
# Add commission of bottom-most category
|
||||
if self.category_id:
|
||||
if self.price_rub > 150_000:
|
||||
commission = self.price_rub * Decimal(settings.COMMISSION_OVER_150K)
|
||||
elif self.category_id:
|
||||
# Add commission of bottom-most category
|
||||
category_commission = getattr(self.category, 'commission', 0)
|
||||
commission += category_commission * self.price_rub / 100
|
||||
commission = self.price_rub / 100 * category_commission
|
||||
else:
|
||||
commission = GlobalSettings.load().commission_rub
|
||||
|
||||
return commission
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user