combination of two data files of different scope

25 views
Skip to first unread message

Dmitri Kourbatsky

unread,
Sep 14, 2019, 4:52:34 PM9/14/19
to Beancount
I keep data in two files:
  • general_file, where I keep my accounts on cash basis (i.e. no debtors/liabilities, all cash expenses recognized immediately),
  • project_file, with particulars about costs of a specific project.

general_file:
  ;entry in 'general' file reflects funds withdrawal
  2017-01-28 * "advance paid" "subcontractor_a" #building
    Assets:Bank                       -500 EUR
    Liabilities:Proprietor             500 EUR
       divert: True

project_file:
  ;project file has posting with costs of job done
  plugin "replace_account "{ 'tag':'building', 'account':'Liabilities:Subcontractor_a'}"
  include <general_file>

  2017-02-15 * "finished 1st stage of thermal insulation" "subcontractor_a"
    Liabilities:Subcontractor_a        -380 EUR
    Expenses:House_maintenance          380 EUR


This structure allows me to query either:
  1. general_file where all expenses are treated in my case as withdrawals (this depends on accounting policy of course, YMMV), or
  2. project_file, where
    - all cash withdrawals are debited to Liabilities account, which holds Dt/Ct balance from/due to subcontractor,
    - all expenses are recorded on accrual basis, and, as result, Expenses account holds relevant Dt amount.
This approach allows me to:
  • decouple maintenance of records of two files, which belong to different scopes,
  • have two different reports, each serving certain goals,
  • avoid recording one transaction in both two files, should I decide to maintain completely separate files

I use modified plugin divert_expenses.py for this to work.


Martin Blais

unread,
Sep 14, 2019, 11:46:08 PM9/14/19
to Beancount
Awesome!
Thx for sharing
> --
> You received this message because you are subscribed to the Google Groups "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/a7237369-bbe0-4a66-936e-2f6c6319230b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages