Skip to content

Commit

Permalink
[FIX] only include payments with outstanding amount
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBForgeFlow committed Apr 26, 2024
1 parent 2f02545 commit 5eb6920
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions account_liquidity_forecast/report/liquidity_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ def _prepare_cash_flow_lines_payment(
("date", "<=", period["date_to"]),
]
if direction == "in":
domain += [("balance", ">", 0.0)]
domain += [("amount_residual", ">", 0.0)]
else:
domain += [("balance", "<", 0.0)]
domain += [("amount_residual", "<", 0.0)]
if period["sequence"] > 0:
domain += [("date", ">=", period["date_from"])]
if data["only_posted_moves"]:
Expand All @@ -225,7 +225,7 @@ def _prepare_cash_flow_lines_payment(
domain += [("move_id.state", "in", ["posted", "draft"])]
balances = self.env["account.move.line"].read_group(
domain=domain,
fields=["balance:sum"],
fields=["amount_residual:sum"],
groupby=["account_id"],
)
for balance in balances:
Expand Down

0 comments on commit 5eb6920

Please sign in to comment.