Browse Source

[account_financial_report][fix] The aged and open items reports should ignore

move lines with a zero balance, even when they have an amount residual.
Those entries can exist as a result of an exchange rate difference.
pull/792/head
Jordi Ballester 4 years ago
parent
commit
4de3a48843
  1. 5
      account_financial_report/report/aged_partner_balance.py
  2. 3
      account_financial_report/report/open_items.py

5
account_financial_report/report/aged_partner_balance.py

@ -111,6 +111,8 @@ class AgedPartnerBalanceReport(models.AbstractModel):
"journal_id", "journal_id",
"account_id", "account_id",
"partner_id", "partner_id",
"debit",
"credit",
"amount_residual", "amount_residual",
"date_maturity", "date_maturity",
"ref", "ref",
@ -153,6 +155,9 @@ class AgedPartnerBalanceReport(models.AbstractModel):
move_line move_line
for move_line in move_lines for move_line in move_lines
if move_line["date"] <= date_at_object if move_line["date"] <= date_at_object
and not float_is_zero(
move_line["debit"] - move_line["credit"], precision_digits=2
)
and not float_is_zero(move_line["amount_residual"], precision_digits=2) and not float_is_zero(move_line["amount_residual"], precision_digits=2)
] ]
for move_line in move_lines: for move_line in move_lines:

3
account_financial_report/report/open_items.py

@ -102,6 +102,9 @@ class OpenItemsReport(models.AbstractModel):
move_line move_line
for move_line in move_lines for move_line in move_lines
if move_line["date"] <= date_at_object if move_line["date"] <= date_at_object
and not float_is_zero(
move_line["debit"] - move_line["credit"], precision_digits=2
)
and not float_is_zero(move_line["amount_residual"], precision_digits=2) and not float_is_zero(move_line["amount_residual"], precision_digits=2)
] ]

Loading…
Cancel
Save