Docs used by hub.darcs.net (eg the front page). Fork this and add questions/answers to make it better. (http://hub.darcs.net)

root / darcshub.journal

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env hledger bal -MEATB revenues expenses -f

; darcs hub project finances in hledger (and Ledger) format.
; Arbitrarily starting 2017/1/1.
; This file has two sections, notes and journal, which can be 
; expanded/collapsed with tab when using emacs orgstruct-mode.

* notes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
** start comment
comment

** accounts overview

assets:      paypal, "cash"
liabilities: 
revenues:    time donations, money donations
expenses:    developer time, hosting, dns, services

** example journal entries

; hosting fee for the coming month (half of my VPS)
1/1 hosting
    expenses:hosting    $30
    assets:cash

; work time contributed by someone (sm) during the past month, with some hourly rate
1/31 work
    expenses:work                                             10 smh @ $100
    assets:cash

** example reports

    # assets/expenses/losses appear positive
    # liabilities/revenues/profits appear negative

*** setup
$ hledger --version  # http://hledger.org/download
$ darcs get http://hub.darcs.net/simon/darcshub-docs
$ cd darcshub-docs
$ chmod +x darcshub.journal

*** monthly income statement in dollars
# ./darcshub.journal, or:
$ hledger -f darcshub.journal bal -MEATB revenues expenses  

*** monthly balance sheet
$ hledger -f darcshub.journal bal -MHE assets liabilities

*** net income this month
$ hledger -f darcshub.journal bal -BN depth:0 revenues expenses date:thismonth  # $10
$ hledger -f darcshub.journal reg -B          revenues expenses date:thismonth

*** net income this year
$ hledger -f darcshub.journal bal -BN depth:0 revenues expenses date:thisyear  # $570
$ hledger -f darcshub.journal reg -B          revenues expenses date:thisyear

*** current net worth
$ hledger -f darcshub.journal bal -BN depth:0 assets liabilities  # -$570
$ hledger -f darcshub.journal reg -B          assets liabilities

** end comment
end comment


* journal ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

2017/1/1 opening balances
    assets:cash   $0

2017/1/1 hosting
    expenses:hosting    $30
    assets:cash

2017/1/31 work
    expenses:work        1.25 smh @ $100
    assets:cash

2017/2/1 hosting
    expenses:hosting    $30
    assets:cash

2017/2/28 work
    expenses:work        3.75 smh @ $100
    assets:cash

2017/3/1 hosting
    expenses:hosting    $30
    assets:cash

2017/3/15 donations
    revenues:donations:paypal                               -$20
    expenses:paypal                                        $1.08
    assets:paypal                                         $18.92

2017/3/16 donations
    revenues:donations:paypal                              -$100
    expenses:paypal                                        $4.20
    assets:paypal                                         $95.80

2017/03/17 donations
    revenues:donations:paypal                                $-3
    expenses:paypal                                        $0.42
    assets:paypal                                          $2.58