diff options
author | Ben Sima <ben@bsima.me> | 2020-12-31 21:42:14 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-12-31 21:42:14 -0500 |
commit | 257f2a956fb676bf2f05e3dc10eb9c15a4b9b219 (patch) | |
tree | 8731b0a1618dcef57ee19992fd83114658b8fd3b | |
parent | a7508431554f817d07963f1feed071dfe5fbcf28 (diff) |
add sats valuation
-rwxr-xr-x | hledger-overview.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hledger-overview.hs b/hledger-overview.hs index 2d7e8e8..2ba5e03 100755 --- a/hledger-overview.hs +++ b/hledger-overview.hs @@ -30,7 +30,7 @@ main = do j <- defaultJournal t <- today let bal = getTotal j t $ defreportopts - let balUSD = getTotal j t $ defreportopts {value_ = inUsdNow} + let balVal = getTotal j t $ defreportopts {value_ = inUsdNow} sec "cash balances" row "simple" (prn $ bal "^as:me:cash:simple status:! status:*") Nothing row "wallet" (prn $ bal "^as:me:cash:wallet") Nothing @@ -42,7 +42,7 @@ main = do sec "metrics" let netLiquid = bal "^as:me:cash ^li:me:cred cur:USD" - let netWorth = balUSD "^as ^li" + let netWorth = balVal "^as ^li" row " in - ex" (prn $ bal "^in ^ex cur:USD") $ Just "keep this negative to make progress" row "cred load" (prn netLiquid) $ Just "net liquid: credit spending minus puren cash assets. keep it positive" row "net worth" (prn netWorth) Nothing @@ -125,6 +125,9 @@ trivial = 0.0001 inUsdNow :: Maybe ValuationType inUsdNow = Just $ AtNow $ Just "USD" +inSatNow :: Maybe ValuationType +inSatNow = Just . AtNow $ Just "SAT" + getTotal :: Journal -> Day -> ReportOpts -> String -> Quantity getTotal j t o q = last . map aquantity $ getTotalAmounts j t o q |