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