Skip to content

Instantly share code, notes, and snippets.

@isoraqathedh
Last active July 20, 2019 12:15
Show Gist options
  • Save isoraqathedh/9efeaff983c1933b6a7b4837b7c53304 to your computer and use it in GitHub Desktop.
Save isoraqathedh/9efeaff983c1933b6a7b4837b7c53304 to your computer and use it in GitHub Desktop.
Periodic transactions and time don't mix.
7177. « ledger-test % ledger -b 2019-01-01 -e 2019-01-07 -f thing.ledger bal Ice
1.17h Ice
7178. « ledger-test % ledger --budget -b 2019-01-01 -e 2019-01-07 -f thing.ledger bal Ice
1.17h
-30.0m Ice
7179. « ledger-test % ledger -b 2019-01-01 -e 2019-01-07 -f thing.ledger bal Fire
$10 Fire
7180. « ledger-test % ledger --budget -b 2019-01-01 -e 2019-01-07 -f thing.ledger bal Fire
$-90 Fire
=====
Commentary:
so it looks like the m inside a budget transaction is not a minute,
but the m in a normal transaction is and will add and subtract with minutes created by timelog entries.
...but, replace "40m" in line 14 with "10m" and suddenly they add again:
7188. « ledger-test % ledger --budget -b 2019-01-01 -e 2019-01-07 -f thing.ledger bal Ice
10.0m Ice
=====
Ledger version 3.1.1-20160111
commodity m
commodity h
commodity $
account Used
account Ice
account Fire
C 1h = 60m
i 2019-01-01 00:00:00 Ice Transaction 1
O 2019-01-01 00:30:00
2019-01-02 * Transaction 2
Ice 40m
Used
~ Weekly
Used
Ice 30m
Fire $100
2019-01-02 * With cash 1
Fire $10
Used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment