I found this nice reddit post that explains almost everything that I need to know.
To re-use the example:
2020-12-29 TECHNIVORM MOCCAMASTER16250 SW 72ND AVE 8556622200 97224 OR USA - Technivorm Moccamaster
expenses:applecard $245.25
liabilities:applecard $-245.25
2020-12-31 AMZN MKTP - Amazon Marketplace
expenses:amazon $16.08
liabilities:applecard $-16.08
2021-01-01 SAFEWAY - Safeway
expenses:groceries $9.74
liabilities:applecard $-9.74
2021-12-31 ACH DEPOSIT INTERNET TRANSFER FROM ACCOUNT ENDING IN 0000 <---- this is the credit card bill payment BUT FROM THE EXPENSES LAST MONTH
assets:bank:checking:my_bofa $-540.87
liabilities:applecard $540.87
The last posting is the payment of the credit card bill, but from the previous month. So when I check the balance for a given month, it seems very hard to separate the actual expenses for the current month and the previous month.
How would that be achievable?
I have two options on my mind, but all seems flawed... so I am interested what the right way of getting the information is.
The balance should show the current state of your assets and liabilities. So, if you buy something but you owe money, you did not really pay, you will have liabilities and when you pay them you will not have liabilities but you will have less money in your assets. But at the end the net worth (assets - liabilities) show you the current state of your balance and is the same one done the expense (net worth of assets minus liabiliaties is the same than the net worth of assets once the payment of credit card is done).
hledger bal assets: liabilities: # net worth, status of your personal finance
Furthermore, the income statement (expenses and revenues) are record when really happen, so to know the expenses of one month you should use:
hledger bal expenses: # expenses
hledger bal expenses: -p april # expenses in april
hledger bal expenses: revenues: -p april # results of the april month: revenues - expenses
Mhmm, I need to think about it.. this is all new to me.
But from my perspective, I am interested in the actual liabilities fo the current month, because the $540.87 are expenses from the previous month.
Maybe my misunderstanding is, that my credit-card-period ends in the middle of the month... so what I actually want is that period (e.g. from the 15.03.24 til 14.04.24; before the bill get's payed from my side), I guess...
Another idea: though it’s slightly more bookkeeping work, if you want to partition each month’s activity you can always add month subacccounts, eg :202412.
Possibly even better is to match not on the account "expenses:" but match on "everything except payments", which involves hledger's "not" filter.
For now, those two might look like the same filter, but in the future, as things become more complicated, it might become easier to think of selecting "everything that isn't a payment".
Sorry if this is irrelevant, but I basically use a different doc# for each statement. I just pull up the postings with that doc# for the ones that should be on that statement. (My system supports doc# classes. Ledger might do better with tags or something; I am new to it, as well.)
Another way may be to link a payment id with each posting it's paying...