FIX: Blocked lines did not have a balance

Balance does not change in a blocked line but still needs to be set
This commit is contained in:
Danny W. Adair
2023-12-19 09:06:00 +13:00
committed by Miquel Raïch
parent 2e0cda6adc
commit 5d85cc1512
2 changed files with 54 additions and 14 deletions

View File

@@ -468,13 +468,14 @@ class ReportStatementCommon(models.AbstractModel):
line["currency_id"], currencies, 0.0, 0.0
)
line_currency = currency_dict[line["currency_id"]]
if not line["blocked"]:
if not is_activity:
if not is_activity:
if not line["blocked"]:
line_currency["amount_due"] += line[amount_field]
line["balance"] = line_currency["amount_due"]
else:
line["balance"] = line_currency["amount_due"]
else:
if not line["blocked"]:
line_currency["ending_balance"] += line[amount_field]
line["balance"] = line_currency["ending_balance"]
line["balance"] = line_currency["ending_balance"]
line["date"] = format_date(
line["date"], date_formats.get(partner_id, default_fmt)
)