File diff 3cc181b24a64 → 438e0688929d
npo-ledger-cli-tutorial.md
Show inline comments
...
 
@@ -66,25 +66,25 @@ someone else is a liability, and that is of course accurate.  Like with the
 
to formalized accounts, such as credit cards, where a monthly statement is
 
sent and have an ongoing liability relationship with the organization.
 

	
 
### Accrued Accounts
 

	
 
For items that are receivable or payable, this system uses `Accrued:`
 
hierarchy.  Under this top-level account, you'll find accounts payable,
 
accounts receivable, loans payable and loans receivable.
 

	
 
### Expense Accounts
 

	
 
These accounts contain any expense of the organization, and all begin with
 
`Expense:`.
 
`Expenses:`.
 

	
 
### Income Accounts
 

	
 
These accounts contain any income of the organization, and all begin with
 
`Income:`.
 

	
 
### Unearned Income Accounts
 

	
 
`Unearned Income:` accounts are used to refer to revenue that is currently
 
received for services which have not yet been delivered.  The most typical
 
and common place an NPO encounters this type of income is for conference
 
registrations.  Since conference registrations arrive in advance of the
...
 
@@ -179,25 +179,25 @@ used in this system.  The actual declarations and enforcement of rules of
 
these tags can be found in the file `accounts/config/config-tags.ledger` in
 
this project.
 

	
 

	
 
### Documentation Tags
 

	
 
Documentation tags are tags that link to other backup documents that provide
 
evidence and details that justify a particular ledger entry.  The value of
 
the tag is a relative path name of a file elsewhere in the same repository
 
that documents the specific expense.  For example, an entry like this:
 

	
 
     2012-02-05 Office Supply Galore - Online Order
 
         Expense:Main Org:Office Supplies      $35.00
 
         Expenses:Main Org:Office Supplies     $35.00
 
             ;Receipt: accounts/documentation/org/receipts/2012-02-05_office-supply-galore.txt
 
         Liabilities:Credit Card:Visa         -$35.00
 

	
 
shows that a purchase was made at Office Supply Galore's online store for
 
$35.00, and the file
 
`accounts/documentation/org/receipts/2012-02-05_office-supply-galore.txt`
 
contains the receipt from that purchase.
 

	
 
#### Receipt Tag
 

	
 
The `Receipt:` tag refers to receipt of some sort.  Typically, this is a
 
document that shows clear confirmation that the transaction has already
...
 
@@ -351,45 +351,45 @@ The possible values for this field are:
 
  as the state or federal government) (e.g., a unrelated business income tax
 
  payment).
 

	
 
* `USA-LLC-No-1099`, indicating that the `Entity` is an LLC, but not the type
 
  of LLC for which the USA requires issuing a 1099.
 

	
 
* `Loan`, indicating that the `Entity` is receiving these funds as a loan
 
  that is expected to be paid back.
 

	
 
#### Program Tag
 

	
 
The `Program` tag is used primarily to track program activity for `Income:`
 
and `Expense:` accounts.  This allows for knowing what particular initiative
 
and `Expenses:` accounts.  This allows for knowing what particular initiative
 
initiated the income (e.g., a specific fundraising campaign) and/or what
 
particular program activity an expense is toward (e.g., funding travel to
 
some specific conference).
 

	
 
The Program tag is always a string with the same format as a Ledger CLI
 
account (primarily for use with Ledger CLI's `--pivot` and `--group-by`,
 
[as described later](#testing-program-success)).
 

	
 
### Account Type Documentation Requirements
 

	
 
Each account type has different documentation requirements.  Based on the
 
type of the account, it requires a different set of tags.
 

	
 
When Ledger CLI's `--pedantic` option is used, these rules are enforced by
 
ledger itself via the configurations found in `config-tags.ledger` and
 
`config-accounts.ledger`.
 

	
 
#### Expense Account Documentation
 

	
 
Each `Expense:` account entry must be tagged with the following tags:
 
Each `Expenses:` account entry must be tagged with the following tags:
 

	
 
* One of: [`Invoice:`](#invoice-tag) [`Receipt:`](#receipt-tag), or
 
  [`Statement`](#statement-tag).  (The only exception to this rule: an entry
 
  does not need an `Invoice:`, `Receipt`, nor a `Statement` tag if the
 
  [payee was never charged](#never-charged-payee).)
 

	
 
* A [`Program:`](#program-tag) tag.
 

	
 
#### NEVER CHARGED Payee
 

	
 
The only exception to the standard tagging requirement is when the payee has
 
been modified to indicate that the expense was `NEVER CHARGED`.  This is an
...
 
@@ -449,25 +449,25 @@ If this methodology is followed, Ledger can be used to analyze the financial
 
data for the organization.
 

	
 
### Testing Program Success
 

	
 
If you use the [`Program`](#program-tag) tag effectively, you can easily test
 
the successes of various fundraising programs with a command like this:
 

	
 
    $ ledger -f accounts/books.ledger --pivot Program bal '/^Income/'
 

	
 
Meanwhile, using the  [`Program`](#program-tag) tag for Expenses can help
 
track what programs are costing with commands like these:
 

	
 
    $ ledger -f accounts/books.ledger --group-by 'tag("Program")' reg '/^Expense/'
 
    $ ledger -f accounts/books.ledger --group-by 'tag("Program")' reg '/^Expenses/'
 

	
 
FIXME: example output
 

	
 
### Checking Integrity of a Tag
 

	
 
[As mentioned](#entity-tag), the `Entity:` tag is one example among many
 
where the value is a wide range, but since Ledger CLI isn't backed by a more
 
complete ERP system, it's possible during data entry for typos to make a
 
serious problem.  One work around to this flaw is to periodically run a
 
command like:
 

	
 
    $ ledger -f accounts/books.ledger -F '%(tag("Entity"))\n' reg|sort|uniq|less