Changeset - 46ff687b0e5e
[Not reviewed]
0 2 0
Bradley Kuhn (bkuhn) - 7 years ago 2017-02-23 22:40:00
bkuhn@ebb.org
Example of finding out if an invoice is paid.
2 files changed with 24 insertions and 1 deletions:
0 comments (0 inline, 0 general)
accounts/org/main-org.ledger
Show inline comments
 
; -*- ledger -*-
 
; -*- coding: utf-8 -*-
 

	
 
!include ../config/config-npo.ledger
 

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

	
 
2011/05/28 My Bad Billing Hosting - NEVER CHARGED
 
    Liabilities:Credit Card:Visa            $-100.00
 
    Expenses:Main Org:Hosting                $100.00
 
        ;Program: Main Org:Overhead
 

	
 
2012/01/01 My Bad Billing Hosting - REVERSAL - NEVER CHARGED
 
    Liabilities:Credit Card:Visa             $100.00
 
    Expenses:Main Org:Hosting               $-100.00
 
        ;Program: Main Org:Overhead
 

	
 
2012-05-03 Sir Moneybags
 
        ;Entity: Sir-Moneybags
 
        ;Program: Main Org:Direct Fundraising
 
        ;Invoice: accounts/documentation/org/invoices/2012-05-30_moneybags-invoice_as-sent.txt
 
    Accrued:Accounts Receivable:Main Org  $100,000.00
 
    Income:Main Org:Donations            $-100,000.00
 
        ;IncomeType: Donations
 
        ;Program: Main Org:Direct Fundraising
 

	
 
2012-07-05 J. Developer
 
        ;Entity: Developer-J
 
        ;Invoice: accounts/documentation/org/expenses/developer/2012-07-05_developer-invoice.txt
 
    Accrued:Accounts Payable:Main Org  $-5,000.00
 
    Expenses:Main Org:Development       $5,000.00
 
        ;Program: Main Org:Software:Internal
 
        ;Statement: accounts/documentation/org/expenses/developer/2012-07-05_developer-report.txt
 

	
 
2012-08-03 (1) J. Developer
 
        ;Entity: Developer-J
 
    Accrued:Accounts Payable:Main Org  $5,000.00
 
        ;Invoice: accounts/documentation/org/expenses/developer/2012-07-05_developer-invoice.txt
 
    Asset:Checking                    $-5,000.00
 
        ;TaxImplication: 1099
 

	
npo-ledger-cli-tutorial.md
Show inline comments
...
 
@@ -421,48 +421,71 @@ it like this:
 
However, going forward, you'd likely never enter anything the ledger
 
**until** you had real proof via an Invoice, Receipt or Statement that showed
 
the Expense did/should occur.  This use of `NEVER CHARGED` in the payee is
 
thus deprecated.
 

	
 
#### Income Account Documentation
 

	
 
Each `Income:` account must have the following tags:
 

	
 
* One of: [`Invoice:`](#invoice-tag),
 
  [`PurchaseOrder:`](#purchase-order-tag),
 
  [`Statement:`](#statement-tag) or
 
  [`Contract`](#contract-tag).  Exceptions to this requirement are as follows:
 
     + the income generated from the transaction is less than $800, or
 
     + the `IncomeType` is `RBI` and the income is for a defined, public
 
       program (such as conference registration)
 

	
 
* An [`Entity:`](#entity-tag) tag, *iff.* the Income for the transaction is
 
  for more than $800.
 

	
 
* An [`IncomeType:`](#incometype-tag) tag.
 

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

	
 
Reports For Various Situations
 
------------------------------
 

	
 
When data is well formed as specified herein, there are various quick reports
 
that can be used to verify certain conditions or issues with accounting.
 
Here are a few examples:
 

	
 
### Verifying That An Invoice Is Paid
 

	
 
Assume for this example that the shell variables `entity`, `program`, and
 
`invoice` are set as follows:
 

	
 
    $ entity=Sir-Moneybags; program='Main.*Org:.*Direct'; invoice=2012-05-30
 
If the invoice was paid, this ledger command will have two lines of output,
 
and the second line will be a transaction on the payment date.  If only one
 
line appears, it's the receivable accrual and we see the invoice is not paid.
 

	
 
    $ ledger -f accounts/books.ledger  -V --sort d --limit 'tag("Entity") =~ /'$entity'/ and tag("Program") =~ /'$program'/ and tag("Invoice") =~ /'$invoice'/' reg /Accrued/
 

	
 
Alternatively, the following command will only have output if the invoice is unpaid:
 

	
 
    $ ledger -f accounts/books.ledger  -V --limit 'tag("Entity") =~ /'$entity'/ and tag("Program") =~ /'$program'/ and tag("Invoice") =~ /'$invoice'/' bal /Accrued/
 

	
 
Analysis of the Data
 
--------------------
 

	
 
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 '/^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
0 comments (0 inline, 0 general)