imp: errors: assertions: improve sample hledger command

This commit is contained in:
Simon Michael 2022-07-31 08:25:17 +01:00
parent 442ef9361c
commit 217cfbd389

View File

@ -607,9 +607,9 @@ checkBalanceAssertionOneCommodityB p@Posting{paccount=assertedacct} assertedamt
"but the calculated balance is: %s", -- (at display precision: %s)", "but the calculated balance is: %s", -- (at display precision: %s)",
"a difference of: %s", "a difference of: %s",
"", "",
"Consider viewing this account's register to troubleshoot. Eg:", "Consider viewing this account's calculated balances to troubleshoot. Eg:",
"", "",
"hledger reg -I '%s'%s" "hledger reg '%s'%s -I # -f FILE"
]) ])
(sourcePosPretty pos) (sourcePosPretty pos)
(textChomp ex) (textChomp ex)
@ -623,7 +623,7 @@ checkBalanceAssertionOneCommodityB p@Posting{paccount=assertedacct} assertedamt
-- (showAmount actualbalincommodity) -- (showAmount actualbalincommodity)
(show $ aquantity assertedamt - aquantity actualbalincomm) (show $ aquantity assertedamt - aquantity actualbalincomm)
(acct ++ if isinclusive then "" else "$") (acct ++ if isinclusive then "" else "$")
(if istotal then "" else (" cur:'"++T.unpack assertedcomm++"'")) (if istotal then "" else (" cur:" ++ quoteForCommandLine (T.unpack assertedcomm)))
where where
acct = T.unpack $ paccount p acct = T.unpack $ paccount p
ass = fromJust $ pbalanceassertion p -- PARTIAL: fromJust won't fail, there is a balance assertion ass = fromJust $ pbalanceassertion p -- PARTIAL: fromJust won't fail, there is a balance assertion