fix: csv: ignore extra whitespace in account rule when detecting virtual postings

Reported by CruxOfTheB in chat.
This commit is contained in:
Simon Michael 2022-10-03 07:50:23 -10:00
parent c0c14e53f1
commit 15b2e7d586

View File

@ -1186,7 +1186,7 @@ getAccount :: CsvRules -> CsvRecord -> Maybe MixedAmount -> Maybe (Amount, Sourc
getAccount rules record mamount mbalance n =
let
fieldval = hledgerFieldValue rules record :: HledgerFieldName -> Maybe Text
maccount = fieldval ("account"<> T.pack (show n))
maccount = T.strip <$> fieldval ("account"<> T.pack (show n))
in case maccount of
-- accountN is set to the empty string - no posting will be generated
Just "" -> Nothing