Skip to content

Instantly share code, notes, and snippets.

@ony
Last active November 12, 2019 21:53
Show Gist options
  • Save ony/dd7c2d13353def16d04cc04a00715d8b to your computer and use it in GitHub Desktop.
Save ony/dd7c2d13353def16d04cc04a00715d8b to your computer and use it in GitHub Desktop.
Use of hledger-rewrite to re-factor journal

Journal

2019/10/1 (44555) FlixBus
	assets
	expenses:transport  $45
	; reimburse:employee

Mark ticket as claimed:

hledger rewrite --add-posting '; claimed:2019-11-12' payee:FlixBus code:44555 expenses:transport

Output:

2019/10/01 (44555) FlixBus  ; modified:
    assets
    expenses:transport               $45
    ; reimburse:employee
    ; claimed:2019-11-12      ; generated-posting: = payee:FlixBus code:44555 expenses:transport

Query

hledger -f - balance --pivot reimburse tag:reimburse tag:claimed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment