Deduce the commission price from the cost
Because the commission price is negative when it has the same type as the invoice. issue11723 review423891003
This commit is contained in:
1 parent
859ea96927
commit
f2f12abcdb
2 files changed
+2
-2
No files matched your search
@@ -20,7 +20,7 @@ class AbstractCommissionMixin:
|
||||
cost = super()._column_cost(tables, withs, sign)
|
||||
if (Transaction().context.get('include_commission')
|
||||
and 'commission_price' in Move._fields):
|
||||
cost += Sum(
|
||||
cost -= Sum(
|
||||
sign * cls.cost.sql_cast(move.internal_quantity)
|
||||
* Coalesce(move.commission_price, 0))
|
||||
return cost
|
||||
|
||||
@@ -191,7 +191,7 @@ Check reporting margin::
|
||||
>>> context['include_commission'] = True
|
||||
>>> with config.set_context(context=context):
|
||||
... report, = MarginProduct.find([])
|
||||
>>> report.cost == Decimal('225.0000')
|
||||
>>> report.cost == Decimal('275.0000')
|
||||
True
|
||||
>>> report.revenue == Decimal('500.0000')
|
||||
True
|
||||
|
||||
Reference in new issue
Block a user