lib: avoid shady Not (Or []) in account type queries

This commit is contained in:
Simon Michael 2021-02-13 14:58:06 -08:00
parent 6c392e9f43
commit b31e40ceca

View File

@ -338,7 +338,8 @@ journalAccountTypeQuery atypes fallbackregex Journal{jdeclaredaccounttypes} =
concat $ mapMaybe (`M.lookup` jdeclaredaccounttypes) atypes
in case declaredacctsoftype of
[] -> Acct fallbackregex
as -> And [ Or acctnameRegexes , Not $ Or differentlyTypedRegexes ]
as -> And $ [ Or acctnameRegexes ]
++ if null differentlyTypedRegexes then [] else [ Not $ Or differentlyTypedRegexes ]
where
-- XXX Query isn't able to match account type since that requires extra info from the journal.
-- So we do a hacky search by name instead.