accrual: Clean up typing after recent bugfix.

This commit is contained in:
Brett Smith 2020-06-05 10:01:36 -04:00
parent 8cf829cc51
commit 87760f6aea

View file

@ -221,13 +221,14 @@ class AccrualPostings(core.RelatedPostings):
self.paid_entities = self.accrued_entities
else:
self.accrual_type = AccrualAccount.classify(self)
norm_func = self.accrual_type.value.norm_func
accrual_acct: Account = self.accrual_type.value
norm_func = accrual_acct.norm_func
self.end_balance = norm_func(self.balance_at_cost())
self.accrued_entities = self._collect_entities(
lambda post: norm_func(post.units).number > 0, # type:ignore[no-any-return]
lambda post: norm_func(post.units).number > 0,
)
self.paid_entities = self._collect_entities(
lambda post: norm_func(post.units).number < 0, # type:ignore[no-any-return]
lambda post: norm_func(post.units).number < 0,
)
def _collect_entities(self,