commission
commission copied to clipboard
Positive commission for credit notes
Module
sale_commission_product_criteria
Describe the bug
When Product Criteria is used as commission type, the settlement of credit notes may create commissions with positive amount.
To Reproduce
Affected versions: at least 14.0 and 16.0
Steps to reproduce the behavior:
- Create a Commission Type, and under type select Product Criteria
- Under rules, create a Rule that applies for a Product Category or Product
- Create a invoice with an agent that use that particular commission type and a product that meets the previously created rule.
- Add a credit note to the very same invoice
- Create a settlement for the agent involved (you may have to register payment, check on Commission Type invoice status)
Expected behavior The settlement should contain a line of commission with a positive amount, related to the invoice. The settlement should contain another line with the same amount, but in this case, as a negative amount, related to the credit note. In reality, there are 2 positive lines with the same amount.
Additional context Tested on v14 CE and v16 CE