mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-19 10:17:35 +03:00
fix: web: Do not hide empty accounts if they have non-empty subaccounts. (#1237)
This commit is contained in:
parent
36f5bc9d23
commit
df424a7a96
@ -84,6 +84,8 @@ balanceReportAsHtml (journalR, registerR) here hideEmpty j q qopts (items, total
|
||||
l = ledgerFromJournal Any j
|
||||
indent a = preEscapedString $ concat $ replicate (2 + 2 * a) " "
|
||||
hasSubAccounts acct = maybe True (not . null . asubs) (ledgerAccount l acct)
|
||||
isInterestingAccount acct = maybe False isInteresting $ ledgerAccount l acct
|
||||
where isInteresting a = not (mixedAmountLooksZero (aebalance a)) || any isInteresting (asubs a)
|
||||
matchesAcctSelector acct = Just True == ((`matchesAccount` acct) <$> inAccountQuery qopts)
|
||||
|
||||
accountQuery :: AccountName -> Text
|
||||
|
@ -7,8 +7,8 @@
|
||||
$forall (acct, adisplay, aindent, abal) <- items
|
||||
<tr
|
||||
:matchesAcctSelector acct:.inacct
|
||||
:mixedAmountLooksZero abal && hideEmpty:.hide>
|
||||
<td .acct :mixedAmountLooksZero abal:.empty>
|
||||
:hideEmpty && not (isInterestingAccount acct):.hide>
|
||||
<td .acct :not (isInterestingAccount acct):.empty>
|
||||
<div .ff-wrapper>
|
||||
\#{indent aindent}
|
||||
<a.acct-name href="@?{(registerR, [("q", replaceInacct q $ accountQuery acct)])}"
|
||||
|
Loading…
Reference in New Issue
Block a user