Changeset - 46ff687b0e5e
[Not reviewed]
0 2 0
Bradley Kuhn (bkuhn) - 4 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
...
 
@@ -21,11 +21,11 @@
 

	
 
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
npo-ledger-cli-tutorial.md
Show inline comments
...
 
@@ -442,6 +442,29 @@ Each `Income:` account must have the following tags:
 

	
 
* 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
 
--------------------
 

	
0 comments (0 inline, 0 general)