Accounts that switch from asset to liability based on value?

321 views
Skip to first unread message

Remco Rijnders

unread,
Oct 6, 2019, 4:20:32 PM10/6/19
to ledge...@googlegroups.com
Hi,

Does anyone know if there is any way to suppress "asset" accounts with a
negative balance (for example, an overdrawn current account) from showing
up in a balance under the normal assets category, and instead have it show
up as a liability in that case only? I know ledger-cli doesn't care, but
the government processing my tax return does. I know that I can do this
adjustment manually myself, but that sort of defeats the purpose of trying
to automate this. I have tried various things with the print command,
--limit filter, etc. but haven't found a satisfactory solution yet. If
there is no simple solution, I am happy to pipe my data through some
script to get to the desired results.

Any ideas?

Many thanks in advance!

Kind regards,

Remco Rijnders

Remco Rijnders

unread,
Oct 6, 2019, 4:59:17 PM10/6/19
to ledge...@googlegroups.com
Ofcourse, after a few more experiments and not too long after writing
this, I think I have found a way... but I am not sure if it is the most
elegant:

ledger equity | grep -v "€ -[0-9]" > tmp; ledger equity | grep "€ -[0-9]" | sed 's/assets/liabilities/' >> tmp ; ledger -f tmp bal

I first translate the balances I am interested in, into equity entries and
then I filter out all lines from this which do not have negative amounts
and store these in a tmp file. Then I repeat this exercise, appending to
the tmp file all records which do have a negative amount, and replace all
"assets" entries with "liabilities" account names.

At this point I have the input I want, and can safely use this for my
reporting needs to make a balance as desired.

It probably is not perfect, but it will do the job for me for now!

Kind regards,

Remco Rijnders

psionl0

unread,
Oct 7, 2019, 12:31:27 AM10/7/19
to Ledger
The sort of accounts you are describing are more correctly a sub-category of "bank" or "equity" account which can have a positive or negative balance.

By definition, an asset account CAN'T have a negative balance. An exception may exist for a sub-category of an asset account but only for adjustment purposes. The parent account overall still can't have a negative balance. Ditto for Liability accounts and positive balances.

If your business has a client who is both a supplier and a purchaser and you both operate on account (not cash only) then you will be writing entries in bot the accounts section and the liability section.

For example, if you purchase a widget from your client (who's name is Johnny Smith) you might make the following entry:
2019/10/07 * Smith, Johnny
   Assets:Widget                     $ 1000.00
   Liabilities:Accounts Payable     $ -1000.00

If you sell a service to the client then the entry would be:
2019/10/07 * Smith, Johnny
   Income:Service                    $ -500.00
   Assets:Accounts Receivable         $ 500.00

When it comes time to settle with this client, the net payment would take into account both the asset and liability accounts:
2019/10/07 * Smith, Johnny
   Liabilities:Accounts Payable      $ 1000.00
   Assets:Accounts Receivable        $ -500.00
   Bank:Checking Account             $ -500.00

Remco Rijnders

unread,
Oct 9, 2019, 8:51:22 PM10/9/19
to ledge...@googlegroups.com
On Sun, Oct 06, 2019 at 09:31:26PM -0700, psionl0 wrote in
<0898bbee-fee3-49df...@googlegroups.com>:
>The sort of accounts you are describing are more correctly a sub-category
>of "bank" or "equity" account which can have a positive or negative balance.
>
>By definition, an asset account CAN'T have a negative balance. An exception
>may exist for a sub-category of an asset account but only for adjustment
>purposes. The parent account overall still can't have a negative balance.
>Ditto for Liability accounts and positive balances.
>
>If your business has a client who is both a supplier and a purchaser and
>you both operate on account (not cash only) then you will be writing
>entries in bot the accounts section and the liability section.
>
>For example, if you purchase a widget from your client (who's name is
>Johnny Smith) you might make the following entry:
>2019/10/07 * Smith, Johnny
> Assets:Widget $ 1000.00
> Liabilities:Accounts Payable $ -1000.00
>
>If you sell a service to the client then the entry would be:
>2019/10/07 * Smith, Johnny
> Income:Service $ -500.00
> Assets:Accounts Receivable $ 500.00
>
>When it comes time to settle with this client, the net payment would take
>into account both the asset and liability accounts:
>2019/10/07 * Smith, Johnny
> Liabilities:Accounts Payable $ 1000.00
> Assets:Accounts Receivable $ -500.00
> Bank:Checking Account $ -500.00

Hi,

Thank you for this and I think I hear what you are saying. That said, I
still think it is not an elegant solution. In my view, the Equity account
should be solely the owners equity or an individuals net worth. Creating a
seperate Bank category would also not be my preference as I'd like to
stick to the five account categories in general use (See:
https://en.wikipedia.org/wiki/Debits_and_credits#The_five_accounting_elements
).

Maybe I used somewhat incorrect terminology in my original post, in my
situation it pertains to the credit/debit position on an account between
two related companies. The credit position on that account at company 1 is
reflected as a debit position on an account with the same name and
characteristics at company 2. Any debit mutation is immediately netted
with an existing credit position and vice versa. I could use the booking
rules as you propose, but then I would always have to do the netting
myself by adjusting Accounts Receivable whenever I adjust Accounts
Payable which also seems cumbersome.

Perhaps what I am looking for, just isn't on offer in ledger? I could
live with that just fine, but thought I would ask anyways :-)

Kind regards,

Remco Rijnders

psionl0

unread,
Oct 10, 2019, 4:47:58 AM10/10/19
to Ledger
I think you will find that every accounting package in the world includes a sixth category for bank accounts. Probably for the reason you give. If a bank account gets overdrawn  then you would suddenly have to change it from an asset account to a liability account.

You are right that what you describe has nothing to do with equity.

If I understand you correctly, Company 1 and Company 2 can change from being a net creditor to a net debtor and vice versa at any time. If this is the case then you really need to leave an audit trail rather than rely on sed to create a report that doesn't exist for your business.

This just means that at the appropriate time (like when you have to submit a report to the tax man), you need to make an adjusting entry. For example, If Company 1 has a net liability account balance of +$500 (meaning that it has become a net asset) then you would make the following entry :
2019/10/10 * Company 1
   Liabilities:Accounts Payable     $ -500.00

   Assets:Accounts Receivable        $ 500.00

I am sure that such adjusting entries would only have to be made a couple of times per year and don't represent any hardship for you.

Remco Rijnders

unread,
Oct 10, 2019, 8:09:00 AM10/10/19
to ledge...@googlegroups.com
On Thu, Oct 10, 2019 at 01:47:58AM -0700, psionl0 wrote in
<937a3b6f-18aa-4269...@googlegroups.com>:
>I think you will find that every accounting package in the world includes a
>sixth category for bank accounts. Probably for the reason you give. If a
>bank account gets overdrawn then you would suddenly have to change it from
>an asset account to a liability account.
>
>You are right that what you describe has nothing to do with equity.
>
>If I understand you correctly, Company 1 and Company 2 can change from
>being a net creditor to a net debtor and vice versa at any time. If this is
>the case then you really need to leave an audit trail rather than rely on
>sed to create a report that doesn't exist for your business.
>
>This just means that at the appropriate time (like when you have to submit
>a report to the tax man), you need to make an adjusting entry. For example,
>If Company 1 has a net liability account balance of +$500 (meaning that it
>has become a net asset) then you would make the following entry :
>2019/10/10 * Company 1
> Liabilities:Accounts Payable $ -500.00
> Assets:Accounts Receivable $ 500.00
>
>I am sure that such adjusting entries would only have to be made a couple
>of times per year and don't represent any hardship for you.

Using your input and suggestions, I think I've come up with a workable
solution for me: I create the account twice, once under the Assets accounts
and once under the Liabilities accounts. I then define an Alias which I
use to do all my bookings to these accounts, in a way I guess this could
be seen as your sixth account category. This way I don't have to figure
out if I have a credit or a debit position after each mutation. When time
comes to make my "official" report, which is only once a year for tax
purposes really, I just ensure that, based on the balance of that account,
the alias is pointing to one account or the other. This gives me exactly
what I want in my report.

It would be nice if this could be done automatically by ledger, perhaps by
using some sort of account command directive, but that would really be
icing on the cake. For now, I consider my question answered and case
closed!

Thank you again for your help!

psionl0

unread,
Oct 10, 2019, 3:46:06 PM10/10/19
to Ledger
Doubling the number of entries instead of making a single adjustment entry at tax time seems like a lot of extra work to me. Not to mention that the standard ledger balance report wouldn't give the true state of your business. You would forever need to use your Alias to get a true picture.

Still, if it works for you then I am happy. Me? I'm a simple sort of person.

Remco Rijnders

unread,
Oct 10, 2019, 6:40:18 PM10/10/19
to ledge...@googlegroups.com
On Thu, Oct 10, 2019 at 12:46:06PM -0700, psionl0 wrote in
<c6ac57a6-976c-4bb0...@googlegroups.com>:
>Doubling the number of entries instead of making a single adjustment entry
>at tax time seems like a lot of extra work to me. Not to mention that the
>standard ledger balance report wouldn't give the true state of your
>business. You would forever need to use your Alias to get a true picture.
>
>Still, if it works for you then I am happy. Me? I'm a simple sort of person.

I think you misunderstood me. I have exactly one entry per
transaction. You first suggested:

> For example, if you purchase a widget from your client (who's name is
> Johnny Smith) you might make the following entry:
> 2019/10/07 * Smith, Johnny
> Assets:Widget $ 1000.00
> Liabilities:Accounts Payable $ -1000.00
>
> If you sell a service to the client then the entry would be:
> 2019/10/07 * Smith, Johnny
> Income:Service $ -500.00
> Assets:Accounts Receivable $ 500.00
>
> When it comes time to settle with this client, the net payment would take
> into account both the asset and liability accounts:
> 2019/10/07 * Smith, Johnny
> Liabilities:Accounts Payable $ 1000.00
> Assets:Accounts Receivable $ -500.00
> Bank:Checking Account $ -500.00

I would book the above now as:

account Assets:Current Account
alias Current Account
account Liabilities:Current Account

2019/10/07 * Smith, Johnny
Assets:Widget $ 1000.00
Current Account $ -1000.00

2019/10/07 * Smith, Johnny
Income:Service $ -500.00
Current Account $ 500.00

Due to the nature of this account (related company), and perhaps my
locality as well, there is no need for me to settle anything. I am just
interested in this showing up in the correct place when I work on my tax
return.

When I run a balance on the above entries, it will report Assets:Current
Account with a balance of $ -500. As this is not what I wish to show in my
report, I change my account entries to:

account Assets:Current Account
account Liabilities:Current Account
alias Current Account

and run the report again. Now the $ -500.00 shows up as a liability as I
want. All I need to do is move the alias once a year (if that, it could
just be correct as it is) and be done with it.

Cheers,

Remco Rijnders

psionl0

unread,
Oct 11, 2019, 5:45:30 AM10/11/19
to Ledger
I think that you missed the fact that I actually wrote a check to Johnny Smith. It was a single check and a single entry that cleared both Johnny Smith accounts simultaneously so that there is no longer an outstanding balance for Johnny Smith.

In my business, I prefer my Ledger entries to match the paperwork I have precisely. I want my balance sheet to show the total of all the bills I still have to pay and the total of all of the invoices that I am waiting for my customers to pay me (even if the payee is the same in both cases). I'm sure the tax man wants it that way too. Calling assets with a positive balance a liability just so that you have a single negative number at the end called "liabilities" doesn't sound like good bookkeeping practice to me.

Similarly, if I pay several invoices to a supplier with a single check then my Ledger entry would look something like this:
2019/10/11 * Smith's Petrol
   Liabilities:Accounts Payable      $ 50.00  ; 0110
   Liabilities:Accounts Payable      $ 40.00  ; 0112
   Liabilities:Accounts Payable      $ 55.00  ; 0122
   Liabilities:Accounts Payable      $ 35.00  ; 0126
   Bank:Checking Account           $ -180.00

This entry shows which invoices were paid (including the supplier's invoice numbers) and when I reconcile my bank statement, the single number at the end will match the amount that was taken out of my bank account.

On Friday, October 11, 2019 at 6:40:18 AM UTC+8, Remco Rijnders wrote:
I think you misunderstood me. I have exactly one entry per
transaction.

Remco Rijnders

unread,
Oct 11, 2019, 8:41:46 AM10/11/19
to ledge...@googlegroups.com
I think we are going around in circles now and misunderstanding what the
other is trying to say or accomplish. I am happy to discuss / clarify it
further off this list should you be interested in that, but I do think it
is no longer on topic for on here.

Thanks again for your help, it helped me find a better solution which
works for me than I came up with before!

Kind regards,

Remco Rijnders

psionl0

unread,
Oct 13, 2019, 5:05:48 AM10/13/19
to Ledger
You are probably right. If I read your example correctly, you ended up recording a sale against a liability account instead of an asset account. This does not conform to accepted bookkeeping practices as I have been taught but if it works for you then that is fine.
Reply all
Reply to author
Forward
0 new messages