Skip to content

Instantly share code, notes, and snippets.

@glguy
Last active September 2, 2021 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glguy/e996b1ea2fef5dd5e8a32f39da8a3f78 to your computer and use it in GitHub Desktop.
Save glguy/e996b1ea2fef5dd5e8a32f39da8a3f78 to your computer and use it in GitHub Desktop.
Tracking signups in my scout ledger
2021-07-22 * Alice | Paid for camp
Events:Summer camp 2021:Alice $-50 ; flow: in
Assets $50
2021-07-23 * Bob | Paid for camp
Events:Summer camp 2021:Bob $-50 ; flow: in
Assets $50
2021-07-24 * Charlie | Paid for camp
Events:Summer camp 2021:Charlie $-50 ; flow: in
Assets $50
2021-07-25 * Alice | Refund for camp
; Couldn't go due to conflicting event
Events:Summer camp 2021:Alice $50 ; flow: in
Assets $-50
2021-07-26 * Camp | Pack camp sign-up
; receipt: 123
Assets $-100
Events:Summer camp 2021:Bob $50 ; flow: out
Events:Summer camp 2021:Charlie $50 ; flow: out
2021-07-27 * David | Paid for camp
; late signup
Assets $50
Events:Summer camp 2021:David $-50 ; flow: in
---
$ hledger-event -f example.ledger
┌────────────────────╥───────┬──────╥──────┐
│ ║ recvd │ paid ║ held │
╞════════════════════╬═══════╪══════╬══════╡
│ Events············ ║ $150 │ $100 ║ $50 │
├────────────────────╫───────┼──────╫──────┤
│ Summer camp 2021 ║ $150 │ $100 ║ $50 │
│ Alice········· ║ - │ - ║ - │
│ Bob··········· ║ $50 │ $50 ║ - │
│ Charlie······· ║ $50 │ $50 ║ - │
│ David········· ║ $50 │ - ║ $50 │
└────────────────────╨───────┴──────╨──────┘
---
$ hledger -f example.ledger bal
$50 Assets
$-50 Events:Summer camp 2021:David
--------------------
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment