Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
; I live together with a flatmate. He transfers me some $ every month to cover
; for the rent & utilities. I pay the bills for all flatmates. Hence, the total
; amount of money I transfer to say the electricity company is not what I spent
; myself on electricity. The automated transaction below splits up the money I
; receive from my flatmate into the different accounts.
= expr account =~ /Expenses:Utilities:Phone/
; Make it look like paying $15 less when paying for the phone bill.
Expenses:Utilities:Phone $-15
Receivables:Flatmates $15
= expr account =~ /Expenses:Utilities:Electricity/
; Make it look like paying 50% less.
Expenses:Utilities:Electricity -0.5
Receivables:Flatmates 0.5
= expr account =~ /Expenses:Rent/ and payee =~ /Scrooge/
; Only deduct when paying money to that specific landlord.
; Use '$account' as a placeholder to not repeat the account's name.
$account $-150
Receivables:Flatmates $150
; Here come the real transactions ...
2042/01/15 * John Doe
; Here I received the money from my flatmate.
Receivables:Flatmates $-205
2042/01/23 * Mr. Scrooge
; Paying the rent to the landlord.
Expenses:Rent $300
2042/01/25 * TalkTalkTalk Inc.
; Paying the phone bill.
Expenses:Utilities:Phone $30
2042/01/31 * HamsterWheel Ltd.
; Paying for electricity.
Expenses:Utilities:Electricity $80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.