imp:accounts: --types shows a tag only when type is known

This commit is contained in:
Simon Michael 2025-09-20 05:53:04 -07:00
parent 18f5c8aa24
commit d9bc45b523

View File

@ -124,9 +124,10 @@ accounts opts@CliOpts{rawopts_=rawopts, reportspec_=ReportSpec{_rsQuery=query,_r
where
indent = T.replicate (2 * (max 0 (accountNameLevel a - drop_ ropts) - 1)) " "
droppedName = accountNameDrop (drop_ ropts) a
showType a
| types = pad a <> " ; type: " <> maybe "" (T.pack . show) (journalAccountType j a)
| otherwise = ""
showType a =
case (types, journalAccountType j a) of
(True, Just t) -> pad a <> " ; type: " <> T.pack (show t)
_ -> ""
showAcctDeclOrder a
| positions =
(if types then "," else pad a <> " ;") <>