summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-12-15 13:07:53 -0500
committerBen Sima <ben@bsima.me>2021-12-15 13:07:53 -0500
commitca1349154510aa4fd693d81a47db90fd8ab46ad0 (patch)
treebfc749931e0bb0c1f39efa535aa4999782f65537
parent240f1bd1ed432d780fa737f78e6e4f7516fc1424 (diff)
Subtract allowances from overview
-rwxr-xr-xhledger-overview.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/hledger-overview.hs b/hledger-overview.hs
index abffcb9..5e296cf 100755
--- a/hledger-overview.hs
+++ b/hledger-overview.hs
@@ -74,9 +74,6 @@ main = do
row " kate" (cur $ bal "^li:me:allowance:kate") Nothing
row " tithe" (cur $ bal "^li:me:church:tithe") Nothing
- -- net cash is limited to USD because that is what I can effectively spend
- let netCash = bal "^as:me:cash ^li:me:cred cur:USD"
- let netWorth = bal "^as ^li"
let (year, month, _) = toGregorian t
let expectedLevel = fromJust $ Map.lookup (roundTo 2 $ (fromIntegral year + fromIntegral month / 12) - (1992 + 7 / 12)) $ levelSchedule cur
let expectedNetWorth = unlevel expectedLevel
@@ -88,8 +85,11 @@ main = do
row " li:as" (Percent_ $ 100 * (- bal "^li") / bal "^as") Nothing
-- let lastyear = 2020
-- row " in:net" (- getTotal j t (defreportopts {value_ = value_, period_ = YearPeriod 2020}) "^in:me") Nothing
- row "cred load" (Target 0 netCash) $ Just "credit spending minus cash. keep it positive"
+ -- net cash is limited to USD because that is what I can effectively spend
+ let netCash = bal "^as:me:cash ^li:me:cred ^li:me:allowance cur:USD"
+ row " net cash" (Target 0 netCash) $ Just "credit spending minus cash/allowances. keep it positive"
row "month nut" (Limit monthlyNut thisMonth) $ Just $ "avg: " <> (display $ Diff $ monthlyNut - thisMonth)
+ let netWorth = bal "^as ^li"
row " bip" (pr $ roundTo 2 $ trivial * netWorth) Nothing
-- ideally: ramen 12 mo, runway 4 yrs.
let (_, _, runwayMo) = runway j t reportopts