finances/README.md

45 lines
2.9 KiB
Markdown
Raw Normal View History

2023-12-15 21:01:00 +00:00
# pub.solar finances
This repository is used to track the finances of pub.solar transparently.
We use [hledger](https://hledger.org/) to create finance report in a minimalistic, terminal friendly
way.
### Quick start
Installing hledger with [nix](https://nixos.org/download), the package manager.
2023-10-31 19:06:24 +00:00
```
2023-12-15 21:01:00 +00:00
git clone gitea@git.pub.solar:pub-solar/finances.git finances && cd $_
nix develop
2023-10-31 19:06:24 +00:00
```
2023-12-15 21:01:00 +00:00
or with [direnv](https://github.com/nix-community/nix-direnv).
```
git clone gitea@git.pub.solar:pub-solar/finances.git finances && cd $_
direnv allow
```
Creating a report without negative numbers
2023-10-31 19:06:24 +00:00
```
hledger incomestatement --file ./finances.hledger --layout bare --pretty --drop 1
2023-10-31 19:06:24 +00:00
```
2023-12-15 21:01:00 +00:00
Creating a web report, viewable in a browser
2023-10-31 19:06:24 +00:00
```
hledger-web --file ./finances.hledger
```
2023-12-15 21:01:00 +00:00
Writing a HTML table to the README
```
hledger incomestatement --file ./finances.hledger --layout bare --pretty --drop 1 -O html >> README.md
```
2023-12-15 21:01:00 +00:00
### Finances report table
<style>
td { padding:0 0.5em; }
td:nth-child(1) { white-space:nowrap; }
tr:nth-child(even) td { background-color:#eee; }
</style><link rel="stylesheet" href="hledger.css"><table><tr><th colspan="3" style="text-align:left"><h2>Income Statement 2023-01-10..2023-12-19</h2></th></tr><tr><th></th><th>Commodity</th><th>2023-01-10..2023-12-19</th></tr><tr><td colspan="3">&nbsp;</td></tr><tr><th colspan="3" style="text-align:left">Revenues</th></tr><tr><td class="account" style="text-align:left">donations:member</td><td class="amount" style="text-align:right"></td><td class="amount" style="text-align:right">365.00</td></tr><tr><td class="account" style="text-align:left">donations:non-member</td><td class="amount" style="text-align:right"></td><td class="amount" style="text-align:right">87.00</td></tr><tr><th style="text-align:left">total</th><th class="amount coltotal" style="text-align:right"></th><th class="amount coltotal" style="text-align:right">452.00</th></tr><tr><td colspan="3">&nbsp;</td></tr><tr><th colspan="3" style="text-align:left">Expenses</th></tr><tr><td class="account" style="text-align:left">infra:domain</td><td class="amount" style="text-align:right"></td><td class="amount" style="text-align:right">52.40</td></tr><tr><td class="account" style="text-align:left">infra:file-storage</td><td class="amount" style="text-align:right"></td><td class="amount" style="text-align:right">26.02</td></tr><tr><td class="account" style="text-align:left">infra:server</td><td class="amount" style="text-align:right"></td><td class="amount" style="text-align:right">124.47</td></tr><tr><th style="text-align:left">total</th><th class="amount coltotal" style="text-align:right"></th><th class="amount coltotal" style="text-align:right">202.89</th></tr><tr><td colspan="3">&nbsp;</td></tr><tr><th style="text-align:left">Net:</th><th class="amount coltotal" style="text-align:right"></th><th class="amount coltotal" style="text-align:right">249.11</th></tr></table>