mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-19 10:17:35 +03:00
register: fix a runtime error with amountless postings
This commit is contained in:
parent
892718a5d9
commit
049baed4d8
@ -151,7 +151,7 @@ postingsReportItemAsText opts (mdate, menddate, mdesc, p, b) =
|
||||
bal = showMixedAmountWithoutPrice b
|
||||
(amtlines, ballines) = (lines amt, lines bal)
|
||||
(amtlen, ballen) = (length amtlines, length ballines)
|
||||
numlines = max amtlen ballen
|
||||
numlines = max 1 (max amtlen ballen)
|
||||
(amtfirstline:amtrest) = take numlines $ amtlines ++ repeat "" -- posting amount is top-aligned
|
||||
(balfirstline:balrest) = take numlines $ replicate (numlines - ballen) "" ++ ballines -- balance amount is bottom-aligned
|
||||
spacer = replicate (totalwidth - (amtwidth + 2 + balwidth)) ' '
|
||||
|
Loading…
Reference in New Issue
Block a user