New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow flexible naming of main account types #523

Open
simonmichael opened this Issue Mar 23, 2017 · 17 comments

Comments

6 participants
@simonmichael
Owner

simonmichael commented Mar 23, 2017

High-level commands like balancesheet/incomestatement/cashflow, and more parts of hledger in future, need to know which accounts are assets, liabilities, equity, revenues, and expenses. Until now this has been done with hard-coded anglo-centric account name patterns. We need to support names in other languages.

The current plan is to write account directives for the top-level accounts and define the account type there. Eg:

account aktivum
  type: A

account forpliktelse 
  type: L

account aksje
  type: Q

account omsetning 
  type: R

account utgift
  type: E

Ie an account tag named type, which would also apply to subaccounts.

Can we foresee any usability issues ? Any other ideas ?

Related:
support the account directive & account metadata #217


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Mar 23, 2017

Owner

Related: #217.

Owner

simonmichael commented Mar 23, 2017

Related: #217.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Mar 23, 2017

Owner

Alternatives & older mockups:

# using a keyword/subdirective rather than a specially-named tag:
account aktivum
  asset          # assets and its subaccounts are asset accounts (by default ? need to override for "contra" accounts ?)

account forpliktelse
  liability      # this and subs are liability accounts

account aksje
  equity

account omsetning
  revenue

account utgift
  expense

account annen   # a special account, not one of the standard types

# a single directive listing the five top-level account names in ALQRE order. Account names may not contain comma.
account-types aktivum, forpliktelse, aksje, omsetning, utgift

# six top-level account names, separated by double space. The first five are the A/L/Q/R/E accounts.
account-roots  assets  liabilities  equity  revenues  expenses  special assets
Owner

simonmichael commented Mar 23, 2017

Alternatives & older mockups:

# using a keyword/subdirective rather than a specially-named tag:
account aktivum
  asset          # assets and its subaccounts are asset accounts (by default ? need to override for "contra" accounts ?)

account forpliktelse
  liability      # this and subs are liability accounts

account aksje
  equity

account omsetning
  revenue

account utgift
  expense

account annen   # a special account, not one of the standard types

# a single directive listing the five top-level account names in ALQRE order. Account names may not contain comma.
account-types aktivum, forpliktelse, aksje, omsetning, utgift

# six top-level account names, separated by double space. The first five are the A/L/Q/R/E accounts.
account-roots  assets  liabilities  equity  revenues  expenses  special assets
@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Mar 23, 2017

Owner
# accounts directive, one-line form. Defines top-level accounts & types.
accounts assets, liabilities, equity, revenues, expenses, special assets
accounts  assets  liabilities  equity  revenues  expenses  special assets

# accounts directive, optional multi-line form.
# Defines account tree, or at least the roots.
# First five root accounts are ALQRE.
# Aside from that, order of names influences default account ordering in reports.
# Comments and tags allowed. Tags propagate to subaccounts.
accounts  ; undeclared-subs:no, special tag disallowing subaccounts not declared here
 assets      ; this and subaccounts are assets. They get an implicit type:A tag.
  bank       ; phone:111-111-1111, url:http://blahblah
   checking
     ; acctno:12345
     ; routingno:123127745
   saving
  cash
 liabilities
  debts
 equity
 revenues
  salary
 expenses  ; undeclared-subs:yes, allow non-pre-declared accounts under expenses
  food
  home
 special assets
  book tokens
  prepaid classes
Owner

simonmichael commented Mar 23, 2017

# accounts directive, one-line form. Defines top-level accounts & types.
accounts assets, liabilities, equity, revenues, expenses, special assets
accounts  assets  liabilities  equity  revenues  expenses  special assets

# accounts directive, optional multi-line form.
# Defines account tree, or at least the roots.
# First five root accounts are ALQRE.
# Aside from that, order of names influences default account ordering in reports.
# Comments and tags allowed. Tags propagate to subaccounts.
accounts  ; undeclared-subs:no, special tag disallowing subaccounts not declared here
 assets      ; this and subaccounts are assets. They get an implicit type:A tag.
  bank       ; phone:111-111-1111, url:http://blahblah
   checking
     ; acctno:12345
     ; routingno:123127745
   saving
  cash
 liabilities
  debts
 equity
 revenues
  salary
 expenses  ; undeclared-subs:yes, allow non-pre-declared accounts under expenses
  food
  home
 special assets
  book tokens
  prepaid classes
@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Mar 23, 2017

Owner

A funding goal of $1,000 has been set for this issue.
Donate via CodeFund.io to support this developer and solve this issue.

Make a Donation!
Why donate? Learn more at www.codefund.io/support-open-source.php

Owner

simonmichael commented Mar 23, 2017

A funding goal of $1,000 has been set for this issue.
Donate via CodeFund.io to support this developer and solve this issue.

Make a Donation!
Why donate? Learn more at www.codefund.io/support-open-source.php

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Mar 23, 2017

Owner

Moving the multi-line accounts directive to #50. For the current issue, a simpler solution will be implemented.

Owner

simonmichael commented Mar 23, 2017

Moving the multi-line accounts directive to #50. For the current issue, a simpler solution will be implemented.

@nniro

This comment has been minimized.

Show comment
Hide comment
@nniro

nniro Jul 11, 2017

Technically, the main account types are only used/mandatory when generating reports and currently, it is possible to use aliases to rename an account to be part of one of these main account types.

How about using the same technique but aliases that are strictly to be used for reports. There are 5 main account types and we could have the same amount to set each alias.

[In a journal file, current alias format is]
alias oldAcctName/Query = newAcctName/Query

[this is what I propose]
alias-asset oldAcctName/Query ; We wouldn't need to set the second part as in alias.
alias-liabilities oldAcctName/Query ; The query will need to support multiple entries and convert each.
etc.

We could even use a similar technique to set the output name of the main account types.

nniro commented Jul 11, 2017

Technically, the main account types are only used/mandatory when generating reports and currently, it is possible to use aliases to rename an account to be part of one of these main account types.

How about using the same technique but aliases that are strictly to be used for reports. There are 5 main account types and we could have the same amount to set each alias.

[In a journal file, current alias format is]
alias oldAcctName/Query = newAcctName/Query

[this is what I propose]
alias-asset oldAcctName/Query ; We wouldn't need to set the second part as in alias.
alias-liabilities oldAcctName/Query ; The query will need to support multiple entries and convert each.
etc.

We could even use a similar technique to set the output name of the main account types.

@cwarden

This comment has been minimized.

Show comment
Hide comment
@cwarden

cwarden Jul 16, 2017

Collaborator

#584 raises the issue of needing to exclude some asset accounts from the cashflow report.

Perhaps we should tackle this from the report side rather than from the account side by making the default queries for each report to be configurable, e.g

cashflow ^assets not:receivable
balancesheet-assets ^assets
balancesheet-liabilities ^liabilities
balancesheet-equity ^equity
incomestatement-revenue ^income
incomestatement-expenses ^expenses
Collaborator

cwarden commented Jul 16, 2017

#584 raises the issue of needing to exclude some asset accounts from the cashflow report.

Perhaps we should tackle this from the report side rather than from the account side by making the default queries for each report to be configurable, e.g

cashflow ^assets not:receivable
balancesheet-assets ^assets
balancesheet-liabilities ^liabilities
balancesheet-equity ^equity
incomestatement-revenue ^income
incomestatement-expenses ^expenses
@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jul 16, 2017

Owner

Yes, I wrongly conflated separate issues. This one (#523) is about identifying the top level account types. Choosing accounts and subaccounts to include/exclude for cashflow and other reports is a separate issue, but related.

Owner

simonmichael commented Jul 16, 2017

Yes, I wrongly conflated separate issues. This one (#523) is about identifying the top level account types. Choosing accounts and subaccounts to include/exclude for cashflow and other reports is a separate issue, but related.

@cwarden

This comment has been minimized.

Show comment
Hide comment
@cwarden

cwarden Jul 16, 2017

Collaborator

What do you have in mind with respect to "more parts of hledger in future need[ing] to know which accounts are assets, liabilities, equity, revenues, and expenses"?

Quasar Accounting has the concept of Account Categories, which are a bit different from the ALQRE types you've defined. The Categories are Asset, Liability, Equity, and Income Statement. Here's a sample list of Accounts with Categories:

Name                            Parent Name                     Category
------------------------------  ------------------------------  ------------------------------
ASSETS                                                          Asset
Current Assets                  ASSETS                          Asset
Fixed Asset                     ASSETS                          Asset
Accounts Receivable             Current Assets                  Asset
Bank                            Current Assets                  Asset
Inventory                       Current Assets                  Asset
Other Current Asset             Current Assets                  Asset
EQUITY                                                          Equity
Cost of Goods Sold                                              Income Stmt
Expense                                                         Income Stmt
Income                                                          Income Stmt
Other Expense                                                   Income Stmt
Other Income                                                    Income Stmt
Professional Fees               Expense                         Income Stmt
Repairs and Maintenance         Expense                         Income Stmt
Staff Expenses                  Expense                         Income Stmt
Utilities                       Expense                         Income Stmt
Vehicle Expense                 Expense                         Income Stmt
Sales                           Income                          Income Stmt
LIABILITIES                                                     Liability
Accounts Payable                Current Liabilities             Liability
Credit Card                     Current Liabilities             Liability
Other Current Liability         Current Liabilities             Liability
Current Liabilities             LIABILITIES                     Liability
Long Term Liability             LIABILITIES                     Liability
GST Payable                     Other Current Liability         Liability
PST Payable                     Other Current Liability         Liability

Quickbooks Online has Account Types and Detail Types, where Detail Type is also used as the default Account Name for new Accounts of the Detail Type. The Types are:

Type
------------------------------
Accounts payable (A/P)
Accounts receivable (A/R)
Bank
Cost of Goods Sold
Credit Card
Equity
Expenses
Fixed Assets
Income
Long Term Liabilities
Other Assets
Other Current Assets
Other Current Liabilities
Other Expense
Other Income
Collaborator

cwarden commented Jul 16, 2017

What do you have in mind with respect to "more parts of hledger in future need[ing] to know which accounts are assets, liabilities, equity, revenues, and expenses"?

Quasar Accounting has the concept of Account Categories, which are a bit different from the ALQRE types you've defined. The Categories are Asset, Liability, Equity, and Income Statement. Here's a sample list of Accounts with Categories:

Name                            Parent Name                     Category
------------------------------  ------------------------------  ------------------------------
ASSETS                                                          Asset
Current Assets                  ASSETS                          Asset
Fixed Asset                     ASSETS                          Asset
Accounts Receivable             Current Assets                  Asset
Bank                            Current Assets                  Asset
Inventory                       Current Assets                  Asset
Other Current Asset             Current Assets                  Asset
EQUITY                                                          Equity
Cost of Goods Sold                                              Income Stmt
Expense                                                         Income Stmt
Income                                                          Income Stmt
Other Expense                                                   Income Stmt
Other Income                                                    Income Stmt
Professional Fees               Expense                         Income Stmt
Repairs and Maintenance         Expense                         Income Stmt
Staff Expenses                  Expense                         Income Stmt
Utilities                       Expense                         Income Stmt
Vehicle Expense                 Expense                         Income Stmt
Sales                           Income                          Income Stmt
LIABILITIES                                                     Liability
Accounts Payable                Current Liabilities             Liability
Credit Card                     Current Liabilities             Liability
Other Current Liability         Current Liabilities             Liability
Current Liabilities             LIABILITIES                     Liability
Long Term Liability             LIABILITIES                     Liability
GST Payable                     Other Current Liability         Liability
PST Payable                     Other Current Liability         Liability

Quickbooks Online has Account Types and Detail Types, where Detail Type is also used as the default Account Name for new Accounts of the Detail Type. The Types are:

Type
------------------------------
Accounts payable (A/P)
Accounts receivable (A/R)
Bank
Cost of Goods Sold
Credit Card
Equity
Expenses
Fixed Assets
Income
Long Term Liabilities
Other Assets
Other Current Assets
Other Current Liabilities
Other Expense
Other Income
@mstksg

This comment has been minimized.

Show comment
Hide comment
@mstksg

mstksg Jul 31, 2017

Collaborator

how married are we to having this be configured in the .journal file? since it's basically a configuration of the command line interface (and not an actual journal property), would it be too bad to have it be loaded from a dotfile in the home directory?

Collaborator

mstksg commented Jul 31, 2017

how married are we to having this be configured in the .journal file? since it's basically a configuration of the command line interface (and not an actual journal property), would it be too bad to have it be loaded from a dotfile in the home directory?

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jul 31, 2017

Owner

I don't think it belongs on the command line. You're very unlikely to want to change it, for a given journal. And it's not necessarily going to be the same for all journals you work with. I think the journal is just the right scope for it.

Owner

simonmichael commented Jul 31, 2017

I don't think it belongs on the command line. You're very unlikely to want to change it, for a given journal. And it's not necessarily going to be the same for all journals you work with. I think the journal is just the right scope for it.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jul 31, 2017

Owner

@cwarden useful to see how others do it and what conventional account names are. They seem like variations of the same basic structure. You could mimic them using account aliases.

Owner

simonmichael commented Jul 31, 2017

@cwarden useful to see how others do it and what conventional account names are. They seem like variations of the same basic structure. You could mimic them using account aliases.

@cwarden

This comment has been minimized.

Show comment
Hide comment
@cwarden

cwarden Jul 31, 2017

Collaborator

Keeping the configuration in the journal seems ok to me since you can include it from a dotfile if that makes more sense in your environment.

Collaborator

cwarden commented Jul 31, 2017

Keeping the configuration in the journal seems ok to me since you can include it from a dotfile if that makes more sense in your environment.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jul 31, 2017

Owner

Yes, actually the default journal path is $HOME/.hledger.journal which is kind of a dotfile already (except it's ignored if you specify the path with LEDGER_FILE or -f).

Owner

simonmichael commented Jul 31, 2017

Yes, actually the default journal path is $HOME/.hledger.journal which is kind of a dotfile already (except it's ignored if you specify the path with LEDGER_FILE or -f).

@varac

This comment has been minimized.

Show comment
Hide comment
@varac

varac Dec 11, 2017

would love to have this!

varac commented Dec 11, 2017

would love to have this!

@snowcastle

This comment has been minimized.

Show comment
Hide comment
@snowcastle

snowcastle Feb 9, 2018

This is the only feature I really miss in hledger at the moment.

This is the only feature I really miss in hledger at the moment.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Feb 9, 2018

Owner
Owner

simonmichael commented Feb 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment