cli: Cli.Commands.Balance.renderBalanceAcct: respect that depth is zero-based here (bugfix)

The depth in BalanceReportItem is zero-based,
whereas prrDepth in PeriodicReportRow DisplayName is one-based.
This commit is contained in:
Henning Thielemann 2024-10-03 18:51:59 +02:00 committed by Simon Michael
parent 6b0cca4fa8
commit ccc605a6a0

View File

@ -1333,7 +1333,7 @@ renderBalanceAcct ::
ReportOpts -> Text -> (AccountName, AccountName, Int) -> Text
renderBalanceAcct opts space (fullName, displayName, dep) =
case accountlistmode_ opts of
ALTree -> T.replicate ((dep - 1)*2) space <> displayName
ALTree -> T.replicate (dep*2) space <> displayName
ALFlat -> accountNameDrop (drop_ opts) fullName
-- FIXME. Have to check explicitly for which to render here, since
@ -1343,7 +1343,7 @@ renderPeriodicAcct ::
ReportOpts -> Text -> PeriodicReportRow DisplayName a -> Text
renderPeriodicAcct opts space row =
renderBalanceAcct opts space
(prrFullName row, prrDisplayName row, prrDepth row)
(prrFullName row, prrDisplayName row, prrDepth row - 1)
-- tests