Hi Benjamin
Welcome to the glorious world of plaintext accounting!
The main issue here is that "Assets:Checking $400" account. That exists because in the `Opening Balance` transaction, you need at least two spaces between the account name and the amount. Because there's only one space, at the moment ledger thinks that transaction involves an account called "Assets:Checking $400" with no amount specified.
So if you add at least one more space before "$400" that will fix that - but you'll encounter a different error: "Transaction does not balance". That's because every transaction - even your opening balance! - needs a double entry. At the moment your opening balance transaction doesn't balance against anything else. It's common to use an account like "Equity:Opening balances" to balance that, and then essentially ignore that account. So your new first transaction would look like this:
2023/06/20 * Opening Balance
Assets:Checking $400.00
Assets:Savings $1300.00
Assets:Cash $60.00
Liabilities:MasterCard $400.00
Equity:Opening balances
Now running ledger -f testing.journal bal you'll get something like this:
$1310.00 Assets
$60.00 Cash
$-50.00 Checking
$1300.00 Savings
$-2160.00 Equity:Opening balances
$450.00 Expenses
$100.00 ATM
$200.00 Automobile
$300.00 Boat
$-180.00 Bob
$30.00 Utilities:Gas
$400.00 Liabilities:MasterCard
--------------------
0
And that seems mostly accurate to me. Your checking account is $50 overdrawn (started at $400, $650 in expenses with drawn, then a $200 refund from Bob for a net of $450 withdrawn). Similarly, expenses from Bob net -$180, because you paid him $20 but got $200 back.
However, you're going to run into trouble when you try to pay off that MasterCard. Keep in mind that ledger doesn't have a concept of "assets" and "liabilities" based on account names. It only has accounts. Transactions consist of debits (increases to asset or expense accounts, or decreases to liability or equity accounts) or credits (decreases to asset or expense accounts, or increases to liability or equity accounts). The thing which distinguishes a debit from a credit is the sign (negative or positive).
As your file is set up at the moment, it seems like debits are positive, and credits are negative. That makes sense! Your checking account has +$400 in it at the start; and you owe $400 on your MasterCard. But to show that you _owe_ that money, it should be marked as -$400. Hence your new opening balance transaction might be:
2023/06/20 * Opening Balance
Assets:Checking $400.00
Assets:Savings $1300.00
Assets:Cash $60.00
Liabilities:MasterCard -$400.00
Equity:Opening balances
and then running the balance report:
$1310.00 Assets
$60.00 Cash
$-50.00 Checking
$1300.00 Savings
$-1360.00 Equity:Opening balances
$450.00 Expenses
$100.00 ATM
$200.00 Automobile
$300.00 Boat
$-180.00 Bob
$30.00 Utilities:Gas
$-400.00 Liabilities:MasterCard
--------------------
0
Now this looks totally accurate to me. Some things you can see here:
- you owe $400 to MasterCard (negative in assets/liabilities means "not your money")
- you have $1310 in total assets (positive in assets/liabilities means "your money")
- your net expense with Bob has been -$180, which is another way of saying he's given you $180, because a negative expense is income
Hopefully this helps!
mjec
--
---
You received this message because you are subscribed to the Google Groups "Ledger" group.