Skip to content
Permalink
Browse files

[FIX] account: Invoice Analysis

- Go to Accounting > Reports > Invoices
- Go to the pivot view
- Enable 'Total' and 'Untaxed Total' in the measures

The Total is wrong.

`amount_total` is retrieved on the invoice, unlike the subtotal which is
retreved on the invoice line. We apply the same logic than
`residual_company_signed`.

opw-1950663
  • Loading branch information...
nim-odoo committed Mar 20, 2019
1 parent 4b8e0d8 commit 6820e612ecbb1f32e0c643771d8709a699341bb9
Showing with 2 additions and 1 deletion.
  1. +2 −1 addons/account/report/account_invoice_report.py
@@ -114,7 +114,8 @@ def _sub_select(self):
ai.partner_bank_id,
SUM ((invoice_type.sign_qty * ail.quantity) / u.factor * u2.factor) AS product_qty,
SUM(ail.price_subtotal_signed * invoice_type.sign) AS price_total,
SUM(ai.amount_total * invoice_type.sign) AS amount_total,
(ai.amount_total * invoice_type.sign) / (SELECT count(*) FROM account_invoice_line l where invoice_id = ai.id) *
count(*) * invoice_type.sign AS amount_total,
SUM(ABS(ail.price_subtotal_signed)) / CASE
WHEN SUM(ail.quantity / u.factor * u2.factor) <> 0::numeric
THEN SUM(ail.quantity / u.factor * u2.factor)

0 comments on commit 6820e61

Please sign in to comment.
You can’t perform that action at this time.