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
|
l = ledgerFromJournal Any j
|
||||||
indent a = preEscapedString $ concat $ replicate (2 + 2 * a) " "
|
indent a = preEscapedString $ concat $ replicate (2 + 2 * a) " "
|
||||||
hasSubAccounts acct = maybe True (not . null . asubs) (ledgerAccount l acct)
|
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)
|
matchesAcctSelector acct = Just True == ((`matchesAccount` acct) <$> inAccountQuery qopts)
|
||||||
|
|
||||||
accountQuery :: AccountName -> Text
|
accountQuery :: AccountName -> Text
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
$forall (acct, adisplay, aindent, abal) <- items
|
$forall (acct, adisplay, aindent, abal) <- items
|
||||||
<tr
|
<tr
|
||||||
:matchesAcctSelector acct:.inacct
|
:matchesAcctSelector acct:.inacct
|
||||||
:mixedAmountLooksZero abal && hideEmpty:.hide>
|
:hideEmpty && not (isInterestingAccount acct):.hide>
|
||||||
<td .acct :mixedAmountLooksZero abal:.empty>
|
<td .acct :not (isInterestingAccount acct):.empty>
|
||||||
<div .ff-wrapper>
|
<div .ff-wrapper>
|
||||||
\#{indent aindent}
|
\#{indent aindent}
|
||||||
<a.acct-name href="@?{(registerR, [("q", replaceInacct q $ accountQuery acct)])}"
|
<a.acct-name href="@?{(registerR, [("q", replaceInacct q $ accountQuery acct)])}"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user