Skip to content
Snippets Groups Projects
Commit e8906826 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] account: invoice analysis

- Create a customer invoice of 100, validate
- Refund the invoice
- Go to Accounting > Reports > Business Intelligence > Invoices
- A total of 200 is shown, while it should be 0.
- The same occurs with a vendor bill (-200 instead of 0)

The invoice lines have their sign modified at two places when used in
the report:
- in method `_compute_price` of `account.invoice.line`
- in method `_from` of `account.invoice.report`

The signs are computed with the following combination:

|Invoice type|`_compute_price`|`_from`|Report sign|
|------------|----------------|-------|-----------|
|out_invoice |              +1|     +1|         +1|
|in_invoice  |              +1|     -1|         -1|
|out_refund  |              -1|     -1|         +1|
|in_refund   |              -1|     +1|         -1|

This is not correct: out_invoice and out_refund should have opposite
signs. Same applies to in_invoice and in_refund.

opw-772479
Closes #19954
parent 0e28db88
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment