two ledgers with reciproce transactions

16 views
Skip to first unread message

Marco van Hulten

unread,
Jul 23, 2023, 11:27:05 AM7/23/23
to hle...@googlegroups.com
Hi all,

At the moment I am keeping two different ledgers that have either very
few overlapping accounts (or none at all, depending on how you deal
with it).

# First approach
At the moment, I have a post 'Expenses:Ledger 2' in the first ledger,
and in the second one 'Income:Ledger 1'. If I would ever combine the
two ledgers, it would be nice if these posts cancel each other. This
happens if I alias one account to the other.

# Second approach
Alternatively, I could decide to use the actual account name from the
other ledger. In the first ledger I would instead use the account
'Assets:Bank 2' that was previously only declared in the second ledger.
And so on.

In the future, I might like to use the two ledgers together, probably by
using the include directive.

The advantage of the first approach is that the two income/expense
transactions from the different ledgers will cancel each other out when
used together, but the alias is not so elegant. Alternatively, I do not
call them 'Expenses' or 'Income' but something general like 'External'
or 'Exchange' or 'InOut' or 'Void'.

The second approach makes it more clear that interchange between two
ledgers makes one define transactions that are essentially the same
twice (so it's like double-double-entry accounting). I suppose my
condundrum shows that keeping different books (for a single legal
entity) is a bad idea.

The main issue with the second approach is that the balance on
'Assets:Bank 2' &c. is wrong as long as I am not using the two ledgers
together. I may type

hledger balance not:Bank 2

and so on, to exclude the assets that are missing the many transactions
from the other ledger. Is there a way to specify such a filter in one's
local ".hledgerrc"?

Any advice?

Marco

Marco van Hulten

unread,
Jul 23, 2023, 11:27:05 AM7/23/23
to hle...@googlegroups.com
Je 23 jul 16:44 skribis Marco:
> # First approach
> At the moment, I have a post 'Expenses:Ledger 2' in the first ledger,
> and in the second one 'Income:Ledger 1'. If I would ever combine the
> two ledgers, it would be nice if these posts cancel each other. This
> happens if I alias one account to the other.

I forgot to ask about and mention that this kind of internal "Expenses"
and "Income" introduces a weird asymmetry and I would need to declare
many aliases like

account Cancel
alias Expenses:Ledger 1=Cancel
alias Expenses:Ledger 2=Cancel
alias Income:Ledger 1=Cancel
alias Income:Ledger 2=Cancel

or I could arbitrarily use any of the four as the actual account.

Expenses and Income are the same, further illustrating that keeping two
books is probably wrong. WDYT?

Marco

Simon Michael

unread,
Jul 24, 2023, 12:44:36 PM7/24/23
to hledger
> (Discussion of connecting separate ledger..)

Using an imaginary third account is one of the common ways to bridge two accounts, so that the transactions don't duplicate each other if coexisting as one ledger. I think you covered this as one of your options.

Speaking from my own setup: I keep separate business and personal account trees. I keep them in the same journal file(s) for convenience, but with the idea that they could be separated into completely separate files at any time. My convention is a two letter entity (owner) code at the top, so eg:

JS # joyful systems, business
assets
liabilities
equity
revenues
expenses...
sm # me, personal
assets
liabilties
...

This generalises nicely to owning multiple businesses, etc.

These account names defeat hledger's account type detection, so you have to declare those to make some reports work:

account JS:assets ; type:A
account JS:liabilities ; type:L
...

Now I do have one or two accounts connecting these entities, and in that case I do have to mirror the account on both sides, which is a little tedious, but keeps things clear. Eg:

account JS:liabilities:payable:sm:reimbursement
; money owed to sm for business use of personal funds (or if positive, due from sm for personal use of business funds)

account sm:assets:receivable:JS:reimbursement
; money due from JS for business use of personal funds (or if negative, owed to JS for personal use of business funds)

and a typical transaction:

2023-07-18 * Signal Foundation | RECURRING PAYMENT AUTHORIZED ON 07/17 SIGNAL FOUNDATION SIGNAL.ORG CA S323121942458599 CARD XXXX
sm:assets:bank:wf:pchecking $-5.00
sm:assets:receivable:JS:reimbursement $5.00
JS:liabilities:payable:sm:reimbursement $-5.00
JS:expenses:dues $5.00

Does this help ?
Reply all
Reply to author
Forward
0 new messages