Display balance assertions in hledger web

This commit is contained in:
Saku Laesvuori 2026-01-22 19:13:46 +02:00
parent aa928900f8
commit 912a953f84
2 changed files with 11 additions and 2 deletions

View File

@ -223,6 +223,11 @@ ul {
justify-content: space-between; justify-content: space-between;
} }
.balance-assertion {
filter: contrast(50%);
font-size: smaller;
}
.negative { .negative {
color: #a94442; color: #a94442;
} }

View File

@ -51,14 +51,18 @@ $if elem AddPermission perms
#{tagValue} #{tagValue}
<ul .postings> <ul .postings>
$forall Posting { paccount = acc, pamount = amt, ptags = tags } <- tpostings torig $forall Posting { paccount = acc, pamount = amt, pbalanceassertion = passert, ptags = tags } <- tpostings torig
<li .posting> <li .posting>
<div .posting-row> <div .posting-row>
<div .account> <div .account>
<a href="@?{acctlink acc}##{tindex torig}" title="#{acc}"> <a href="@?{acctlink acc}##{tindex torig}" title="#{acc}">
#{elideAccountName 40 acc} #{elideAccountName 40 acc}
<div .amount style="text-align:right;"> <div .amount style="text-align:right;">
<span .posted-amount>
^{mixedAmountAsHtml amt} ^{mixedAmountAsHtml amt}
$maybe BalanceAssertion { baamount = assertAmt } <- passert
<span .balance-assertion>
jälkeen ^{mixedAmountAsHtml $ mixedAmount assertAmt}
$if null $ filter (isPostingTag acc) $ filter isVisibleTag tags $if null $ filter (isPostingTag acc) $ filter isVisibleTag tags
$else $else
<ul .tags> <ul .tags>