From 1daed940b6f8fc515616731ed7c0188f603f4acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 30 Apr 2023 06:38:01 +0800 Subject: [PATCH] Corrected the definition of the "is_offset" property in the "__get_line_items" method of the OffsetMatcher class. --- src/accounting/report/utils/offset_matcher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/accounting/report/utils/offset_matcher.py b/src/accounting/report/utils/offset_matcher.py index 575c937..9c8f2ac 100644 --- a/src/accounting/report/utils/offset_matcher.py +++ b/src/accounting/report/utils/offset_matcher.py @@ -123,15 +123,15 @@ class OffsetMatcher: .options(selectinload(JournalEntryLineItem.currency), selectinload(JournalEntryLineItem.journal_entry)).all() for line_item in self.line_items: - line_item.is_offset = line_item.id in net_balances + line_item.is_offset = line_item.id not in net_balances self.unapplied = [x for x in self.line_items - if x.is_offset] + if not x.is_offset] for line_item in self.unapplied: line_item.net_balance = line_item.amount \ if net_balances[line_item.id] is None \ else net_balances[line_item.id] self.unmatched = [x for x in self.line_items - if not x.is_offset] + if x.is_offset] self.__populate_accumulated_balances() def __populate_accumulated_balances(self) -> None: