Renamed the _set_is_need_offset method to _set_need_offset in the BaseTestData class in testlib_offset.py.

This commit is contained in:
依瑪貓 2023-04-09 10:34:33 +08:00
parent f47e9b3150
commit dabe6ddbca
2 changed files with 6 additions and 10 deletions

View File

@ -500,16 +500,14 @@ class DifferentTestData(BaseTestData):
5, [JournalEntryCurrencyData( 5, [JournalEntryCurrencyData(
"USD", [self.l_p_of5d], [self.l_p_of5c])]) "USD", [self.l_p_of5d], [self.l_p_of5c])])
self._set_is_need_offset({Accounts.RECEIVABLE, Accounts.PAYABLE}, self._set_need_offset({Accounts.RECEIVABLE, Accounts.PAYABLE}, False)
False)
self._add_journal_entry(self.j_r_of1) self._add_journal_entry(self.j_r_of1)
self._add_journal_entry(self.j_r_of2) self._add_journal_entry(self.j_r_of2)
self._add_journal_entry(self.j_r_of3) self._add_journal_entry(self.j_r_of3)
self._add_journal_entry(self.j_p_of1) self._add_journal_entry(self.j_p_of1)
self._add_journal_entry(self.j_p_of2) self._add_journal_entry(self.j_p_of2)
self._add_journal_entry(self.j_p_of3) self._add_journal_entry(self.j_p_of3)
self._set_is_need_offset({Accounts.RECEIVABLE, Accounts.PAYABLE}, self._set_need_offset({Accounts.RECEIVABLE, Accounts.PAYABLE}, True)
True)
class SameTestData(BaseTestData): class SameTestData(BaseTestData):
@ -663,8 +661,7 @@ class SameTestData(BaseTestData):
15, [JournalEntryCurrencyData( 15, [JournalEntryCurrencyData(
"USD", [self.l_p_of6d], [self.l_p_of6c])]) "USD", [self.l_p_of6d], [self.l_p_of6c])])
self._set_is_need_offset({Accounts.RECEIVABLE, Accounts.PAYABLE}, self._set_need_offset({Accounts.RECEIVABLE, Accounts.PAYABLE}, False)
False)
self._add_journal_entry(self.j_r_of1) self._add_journal_entry(self.j_r_of1)
self._add_journal_entry(self.j_r_of2) self._add_journal_entry(self.j_r_of2)
self._add_journal_entry(self.j_r_of4) self._add_journal_entry(self.j_r_of4)
@ -675,7 +672,6 @@ class SameTestData(BaseTestData):
self._add_journal_entry(self.j_p_of4) self._add_journal_entry(self.j_p_of4)
self._add_journal_entry(self.j_p_of5) self._add_journal_entry(self.j_p_of5)
self._add_journal_entry(self.j_p_of6) self._add_journal_entry(self.j_p_of6)
self._set_is_need_offset({Accounts.RECEIVABLE, Accounts.PAYABLE}, self._set_need_offset({Accounts.RECEIVABLE, Accounts.PAYABLE}, True)
True)
self._add_journal_entry(self.j_r_of3) self._add_journal_entry(self.j_r_of3)
self._add_journal_entry(self.j_p_of3) self._add_journal_entry(self.j_p_of3)

View File

@ -225,7 +225,7 @@ class BaseTestData(ABC):
journal_entry_data.currencies[i].credit[j].id \ journal_entry_data.currencies[i].credit[j].id \
= journal_entry.currencies[i].credit[j].id = journal_entry.currencies[i].credit[j].id
def _set_is_need_offset(self, account_codes: set[str], def _set_need_offset(self, account_codes: set[str],
is_need_offset: bool) -> None: is_need_offset: bool) -> None:
"""Sets whether the line items in some accounts need offset. """Sets whether the line items in some accounts need offset.