[FIX] account: invoice analysis total always positive
Create a Credit Note, save and confirm Go to Reporting>Invoice Analysis Switch to Pivot view, add mesures ntaxed Total and Total, expand rows by Move. The credit note untaxed total is correctly reported as negative, total is reported as positive opw-3223043 closes odoo/odoo#116421 X-original-commit: 06b1f3d0c78fc22250fc544b4c3152a58bfbe05c Signed-off-by: John Laterre (jol) <jol@odoo.com>
This commit is contained in:
@@ -98,7 +98,8 @@ class AccountInvoiceReport(models.Model):
|
||||
line.quantity / NULLIF(COALESCE(uom_line.factor, 1) / COALESCE(uom_template.factor, 1), 0.0) * (CASE WHEN move.move_type IN ('in_invoice','out_refund','in_receipt') THEN -1 ELSE 1 END)
|
||||
AS quantity,
|
||||
-line.balance * currency_table.rate AS price_subtotal,
|
||||
line.price_total,
|
||||
line.price_total * (CASE WHEN move.move_type IN ('in_invoice','out_refund','in_receipt') THEN -1 ELSE 1 END)
|
||||
AS price_total,
|
||||
-COALESCE(
|
||||
-- Average line price
|
||||
(line.balance / NULLIF(line.quantity, 0.0)) * (CASE WHEN move.move_type IN ('in_invoice','out_refund','in_receipt') THEN -1 ELSE 1 END)
|
||||
|
||||
Reference in New Issue
Block a user