1
0
Files
plaintextaccounting/quickref/index.html
Simon Michael b6bf2ee405 a combined quick reference, aka "rosetta stone"
Covers the essentials of Ledger/hledger/Beancount journal format.
The master copy is in google docs for easier table editing,
but this will likely change in future.
2016-03-14 08:49:45 -07:00

1106 lines
24 KiB
HTML
Executable File

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/skeleton.css">
<link rel="stylesheet" href="css/site.css">
<link rel="icon" type="image/png" href="images/favicon.png">
<link href="quickref.css" rel="stylesheet">
</head>
<body class="c13">
<div class="container">
<p class="c30">
<span style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 99.79px; height: 116.80px;">
<img alt="270px-Rosetta_Stone.JPG" src="images/image00.jpg" style="width: 99.79px; height: 116.80px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);" title="">
</span>
</p>
<h2 class="c18" id="h.pm8s15w9ugw8">
<span>
</span>
</h2>
<h2 class="c27" id="h.ejyq5tnqecv7">
<span>
Quick Reference for the Ledger-Likes</span>
</h2>
<p class="c32">
<span>
Some information about the major </span>
<span>
Plain Text Accounting</span>
<span>
&nbsp;implementations, drawn from existing docs and informal testing, that I needed to see in one place. Currently, it compares the main journal syntax for Ledger, hledger and Beancount. For more, see the manuals and cheatsheets linked below, or </span>
<span class="c0">
<a class="c15" href="https://www.google.com/url?q=http://plaintextaccounting.org&amp;sa=D&amp;ust=1457973774555000&amp;usg=AFQjCNF3O8_XoTV5h9H9b6ls5Dt8C52MUQ">
http://plaintextaccounting.org</a>
</span>
<span>
. </span>
<span>
I hope you find it useful.</span>
</p>
<p class="c32">
<span>
First draft, created 2016/03, corrections to: sm on </span>
<span class="c0">
<a class="c15" href="https://www.google.com/url?q=http://webchat.freenode.net/?channels%3Dhledger&amp;sa=D&amp;ust=1457973774557000&amp;usg=AFQjCNGJdTJRggwYN8zUan2d1oQLdW2VNA">
#hledger</a>
</span>
<span>
&nbsp;or </span>
<span class="c0">
<a class="c15" href="https://www.google.com/url?q=http://webchat.freenode.net/?channels%3Dledger&amp;sa=D&amp;ust=1457973774558000&amp;usg=AFQjCNFk6vwvHeP3uGdyTZZXFwB6CUJfZg">
#ledger</a>
</span>
<span>
&nbsp;or </span>
<span class="c0">
<a class="c15" href="https://www.google.com/url?q=http://webchat.freenode.net/?channels%3Dbeancount&amp;sa=D&amp;ust=1457973774560000&amp;usg=AFQjCNH2SAtExdmJ93kZUnLSlG8pXmNI9w">
#beancount</a>
</span>
<span>
, or the </span>
<span class="c0">
<a class="c15" href="https://www.google.com/url?q=https://docs.google.com/document/d/1L5OyRZ4nxQVjZJugyEyYi_H-229yaWV-yx0raAO1iog/edit?usp%3Dsharing&amp;sa=D&amp;ust=1457973774561000&amp;usg=AFQjCNHJaGDcJlH_PDJ56wCla4T3QDyGig">
google doc</a>
</span>
</p>
<p class="c3 c32">
<span>
</span>
</p>
<p class="c28">
<span class="c0">
<a class="c15" href="#h.ejyq5tnqecv7">
Quick Reference for the Ledger-Likes</a>
</span>
</p>
<p class="c29">
<span class="c0">
<a class="c15" href="#h.tqmbtluf328a">
Journal Format</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.8v2r9qqwt9f8">
Basic example</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.1n05blr44u7c">
Comments</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.gij3l494xeth">
Basic transactions</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.xpr0dgy4pyj3">
Dates</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.n4b87oz9ku6t">
Account names</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.9xaw86fvi6s6">
More transaction features</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.d2g5xagy7h37">
Prices</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.mjrjnr996vfg">
Balance assertions, resets</a>
</span>
</p>
<p class="c34">
<span class="c0">
<a class="c15" href="#h.au5ysr0kfa">
Directives</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.3v5cafffbbft">
account, open</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.22qss13648tb">
close</a>
</span>
</p>
<p class="c17">
<span class="c0">
<a class="c15" href="#h.n9q16dsjsoye">
commodity</a>
</span>
</p>
<h4 class="c21" id="h.wve8xialq0o3">
<span>
</span>
</h4>
<h3 class="c25" id="h.tqmbtluf328a">
<span>
Journal Format</span>
</h3>
<p>
<span>
Legend</span>
<span>
: <br>
Things in </span>
<span class="c9">
[ ] </span>
<span>
are</span>
<span>
&nbsp;optional. <br>
Syntax should be the latest preferred syntax for each implementation, may be incomplete. <br>
Some notes in the Ledger column are common to all.<br>
<br>
</span>
</p>
<a id="t.07c7f4bd63bd84afda72eb240ea9f2bc849e552a">
</a>
<a id="t.0">
</a>
<table class="c35">
<tbody>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<p class="c2 c3">
<span class="c10 c20">
</span>
</p>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c24">
<span>
Ledger<br>
</span>
<span class="c0 c1">
<a class="c15" href="https://www.google.com/url?q=http://ledger-cli.org/3.0/doc/ledger3.html%23Journal-Format&amp;sa=D&amp;ust=1457973774582000&amp;usg=AFQjCNFajtqFSx9DTpwWy4oP22IaSIvXSw">
http://ledger-cli.org/3.0/doc/ledger3.html#Journal-Format</a>
</span>
<span class="c1">
<br>
</span>
<span class="c0 c1">
<a class="c15" href="https://www.google.com/url?q=http://ricostacruz.com/cheatsheets/ledger.html&amp;sa=D&amp;ust=1457973774583000&amp;usg=AFQjCNE9y8paIxBycuhNzGgoC6be8ISJ_A">
http://ricostacruz.com/cheatsheets/ledger.html</a>
</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c24">
<span>
Hledger<br>
</span>
<span class="c0 c14">
<a class="c15" href="https://www.google.com/url?q=http://hledger.org/manual.html%23journal&amp;sa=D&amp;ust=1457973774585000&amp;usg=AFQjCNEp8OC3kyDh0-p0Z_7voHFxv6dnkw">
http://hledger.org/manual.html#journal</a>
</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c24">
<span>
Beancount<br>
</span>
<span class="c0 c14">
<a class="c15" href="https://www.google.com/url?q=http://furius.ca/beancount/doc/syntax&amp;sa=D&amp;ust=1457973774587000&amp;usg=AFQjCNGNepo5m8oWQKPpRPcSemyaOfLoAw">
http://furius.ca/beancount/doc/syntax</a>
</span>
<span class="c14">
<br>
</span>
<span class="c0 c14 c33">
<a class="c15" href="https://www.google.com/url?q=http://furius.ca/beancount/doc/cheatsheet&amp;sa=D&amp;ust=1457973774589000&amp;usg=AFQjCNFyp8VNmMDlciVe5PEWhCItmumibw">
http://furius.ca/beancount/doc/cheatsheet</a>
</span>
</p>
<p class="c3 c24">
<span class="c10 c22">
</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.8v2r9qqwt9f8">
<span>
Basic example</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
; a comment<br>
<br>
2016/1/1 set opening balance<br>
&nbsp; &nbsp;assets:checking &nbsp; &nbsp; &nbsp; $500.00<br>
&nbsp; &nbsp;equity:opening balances<br>
<br>
2016/1/5 farmer&#39;s market<br>
&nbsp; &nbsp;expenses:groceries &nbsp; &nbsp; $50.00<br>
&nbsp; &nbsp;Assets:checking<br>
<br>
<br>
<br>
<br>
<br>
</span>
<span class="c10 c1">
Comments, directives, and/or transactions in any order</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c12 c9 c1">
; a comment<br>
<br>
2016/1/1 set opening balance<br>
&nbsp; &nbsp;assets:checking &nbsp; &nbsp; &nbsp; $500.00<br>
&nbsp; &nbsp;equity:opening balances<br>
<br>
2016/1/5 farmer&#39;s market<br>
&nbsp; &nbsp;expenses:groceries &nbsp; &nbsp; $50.00<br>
&nbsp; &nbsp;assets:checking</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
; a comment<br>
<br>
2016-01-01 open Assets:Checking<br>
2016-01-01 open Equity:Opening-Balances<br>
2016-01-01 open Expenses:Groceries<br>
<br>
2016-01-01 txn &quot;set opening balance&quot;<br>
&nbsp; &nbsp;Assets:Checking &nbsp; &nbsp; &nbsp; &nbsp; 500.00 USD<br>
&nbsp; &nbsp;Equity:Opening-Balances<br>
<br>
2016/1/5 txn &quot;farmer&#39;s market&quot;<br>
&nbsp; &nbsp;Expenses:Groceries &nbsp; &nbsp; 50 USD<br>
&nbsp; &nbsp;Assets:Checking<br>
<br>
</span>
<span class="c1">
All referenced accounts must have an open directive</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.1n05blr44u7c">
<span>
Comments</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
; comment<br>
# comment<br>
% comment<br>
| comment<br>
* comment and org-mode outline node<br>
<br>
</span>
<span class="c10 c1">
Non-comment lines may end with a comment<br>
Indented comments are attached to the preceding transaction or posting</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c12 c9 c1">
; comment<br>
# comment<br>
* comment and org-mode outline node<br>
</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
; comment<br>
Any unrecognised line is also a comment<br>
<br>
<br>
<br>
<br>
</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.gij3l494xeth">
<span>
Basic transactions</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
DATE [DESCRIPTION]<br>
&nbsp; &nbsp;ACCOUNT &nbsp; &nbsp;AMOUNT<br>
&nbsp; &nbsp;ACCOUNT &nbsp; &nbsp;[AMOUNT]<br>
<br>
</span>
<span class="c10 c1">
A transaction contains any number of indented postings (usually two), whose amounts must sum to zero<br>
At least two spaces required between account and amount<br>
The final amount is optional<br>
</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
DATE [DESCRIPTION]<br>
&nbsp; &nbsp;ACCOUNT &nbsp; &nbsp;AMOUNT<br>
&nbsp; &nbsp;ACCOUNT &nbsp; &nbsp;[AMOUNT]<br>
<br>
</span>
<span class="c10 c1">
Same</span>
</p>
<p class="c2 c3">
<span class="c10 c1">
</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
DATE txn [&quot;DESCRIPTION&quot;]<br>
&nbsp; &nbsp;ACCOUNT &nbsp; &nbsp;AMOUNT<br>
&nbsp; &nbsp;ACCOUNT &nbsp; &nbsp;[AMOUNT]<br>
<br>
</span>
<span class="c1 c10">
DESCRIPTION must be in double quotes, can be multiline<br>
No need for two spaces between account and amount</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.xpr0dgy4pyj3">
<span>
Dates</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
YYYY-MM-DD<br>
YYYY/MM/DD<br>
YYYY.MM.DD<br>
MM-DD<br>
MM/DD<br>
MM.DD<br>
<br>
</span>
<span class="c1">
Other formats specified with</span>
<span class="c12 c9 c1">
&nbsp;--input-date-format </span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c12 c9 c1">
YYYY-MM-DD<br>
YYYY/MM/DD<br>
YYYY.MM.DD<br>
MM-DD<br>
MM/DD<br>
MM.DD</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
YYYY-MM-DD<br>
YYYY/MM/DD<br>
YYYY.MM.DD<br>
<br>
<br>
<br>
<br>
</span>
<span class="c10 c1">
Only YYYY-MM-DD with 8 digits is officially supported</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.n4b87oz9ku6t">
<span class="c7">
Account names</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
TOPACCT[:SUBACCT[:...]]<br>
<br>
Revenues:Salary<br>
liabilities:credit card:CITI 1234<br>
other assets:house<br>
<br>
</span>
<span class="c10 c1">
Account names begin with a letter<br>
May contain single spaces<br>
May contain subaccounts separated by :</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
TOPACCT[:SUBACCT[:...]]<br>
<br>
<br>
<br>
<br>
<br>
</span>
<span class="c10 c1">
Same</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
TOPACCT[:SUBACCT[:...]]<br>
<br>
Income:Salary<br>
Liabilities:CreditCard:CITI-1234<br>
Assets:House<br>
<br>
</span>
<span class="c1">
Top level account must be one of Assets, Liabilities, Equity, Income, Expenses<br>
Each subaccount must be capitalised<br>
Letters, digits and hyphen are allowed (no spaces)</span>
<span class="c12 c9 c1">
&nbsp;</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.n4b87oz9ku6t-1">
<span class="c7">
Amounts</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
One of<br>
COMMODITY QUANTITY<br>
QUANTITY COMMODITY<br>
QUANTITY<br>
<br>
$10.00<br>
1,000.0001 USD<br>
10 &quot;prepaid classes&quot;<br>
1.000.000,01<br>
10<br>
<br>
<br>
</span>
<span class="c1">
COMMODITY is a symbol, word or phrase; if it contains spaces or numbers, it must be in double quotes<br>
It can be on the left or right, with or without a separating space<br>
QUANTITY is a number with 0 or more decimal places<br>
Decimal point can be </span>
<span class="c1 c19">
.</span>
<span class="c1">
&nbsp;or </span>
<span class="c1 c19">
,</span>
<span class="c1">
<br>
Digits can be grouped into thousands by </span>
<span class="c1 c19">
,</span>
<span class="c1">
&nbsp;or </span>
<span class="c1 c19">
.</span>
<span class="c10 c1">
<br>
Amount styles influence the standard display style for each commodity</span>
</p>
<p class="c2 c3">
<span class="c10 c1">
</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
One of<br>
COMMODITY QUANTITY<br>
QUANTITY COMMODITY<br>
QUANTITY<br>
<br>
$10.00<br>
1,000.0001 USD<br>
10 &quot;prepaid classes&quot;<br>
1.000.000,01<br>
10<br>
12,34,567.89<br>
<br>
</span>
<span class="c10 c1">
Similar<br>
Digits can be grouped any way, not just thousands</span>
</p>
<p class="c2 c3">
<span class="c10 c1">
</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
QUANTITY COMMODITY<br>
<br>
<br>
<br>
<br>
10USD<br>
1000.0001 USD<br>
<br>
<br>
<br>
<br>
<br>
</span>
<span class="c1">
COMMODITY is all capital letters, on the right, and required</span>
<span class="c9 c1">
<br>
</span>
<span class="c1">
Decimal point must be </span>
<span class="c1 c19">
.</span>
<span class="c1">
<br>
Digit group separator </span>
<span class="c1 c19">
,</span>
<span class="c10 c1">
&nbsp;is allowed and ignored</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.9xaw86fvi6s6">
<span class="c19 c26">
More transaction</span>
<span>
&nbsp;</span>
<span class="c7">
features</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
DATE [FLAG] [(CODE)] DESCRIPTION<br>
&nbsp; &nbsp;[FLAG] ACCOUNT &nbsp;AMOUNT [PRICE] [=BAL]<br>
&nbsp; &nbsp;...<br>
&nbsp; &nbsp;[FLAG] ACCOUNT &nbsp;[AMOUNT [PRICE] [=BAL]]<br>
<br>
</span>
<span class="c10 c1">
FLAG (aka STATE) is empty, ! or * meaning uncleared, pending or cleared<br>
CODE is any string, in parentheses<br>
DESCRIPTION can be a payee name, narration, or both</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c12 c9 c1">
DATE [FLAG] [(CODE)] DESCRIPTION<br>
&nbsp; &nbsp;[FLAG] ACCOUNT &nbsp;AMOUNT [PRICE] [=BAL]<br>
&nbsp; &nbsp;...<br>
&nbsp; &nbsp;[FLAG] ACCOUNT &nbsp;AMOUNT [PRICE] [=BAL]</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
DATE [txn|FLAG] [[&quot;PAYEE&quot;] &quot;DESCRIPTION&quot;]<br>
&nbsp; &nbsp;[FLAG] ACCOUNT &nbsp; &nbsp; &nbsp; AMOUNT [PRICES]<br>
&nbsp; &nbsp;...<br>
&nbsp; &nbsp;[FLAG] ACCOUNT &nbsp; &nbsp; &nbsp; AMOUNT [PRICES]<br>
<br>
</span>
<span class="c1">
The txn keyword may be replaced by a FLAG<br>
For just a payee, use &quot;PAYEE&quot; &quot;&quot;<br>
</span>
<span class="c12 c9 c1">
&nbsp;</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.d2g5xagy7h37">
<span class="c7">
Prices</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
One of<br>
@ UNITPRICE<br>
@@ TOTALPRICE<br>
and/or one of<br>
{LOTUNITPRICE}<br>
{=FIXEDLOTUNITPRICE}<br>
and/or<br>
[LOTDATE]<br>
<br>
</span>
<span class="c10 c1">
A UNITPRICE or TOTALPRICE also records a market price on this date<br>
A LOTDATE is written in square brackets</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
One of<br>
@ FIXEDUNITPRICE<br>
@@ FIXEDTOTALPRICE<br>
and/or<br>
{=FIXEDLOTUNITPRICE}<br>
<br>
<br>
<br>
<br>
</span>
<span class="c10 c1">
These do not record market prices<br>
The lot price syntax is ignored</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c5">
<span class="c9 c1">
{LOTUNITPRICE[ / LOTDATE]}<br>
and/or one of<br>
@ UNITPRICE<br>
@@ TOTALPRICE<br>
<br>
<br>
<br>
<br>
</span>
<span class="c10 c1">
Lot prices are remembered and form distinct commodities, other prices are not<br>
If there is both a lot price and a regular price, the latter records a market price</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.mjrjnr996vfg">
<span class="c7">
Balance assertions</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
= AMOUNT (after posting amount &amp; price)<br>
<br>
2016-03-10<br>
&nbsp; &nbsp;Expenses:Food &nbsp; &nbsp; &nbsp;$20<br>
&nbsp; &nbsp;Assets:Cash &nbsp; &nbsp; &nbsp; $-20 = $80<br>
<br>
</span>
<span class="c10 c1">
Asserts the balance in this commodity <br>
in this account, excluding subaccounts<br>
at this point in the parse order</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
= AMOUNT (after posting amount &amp; price)<br>
<br>
<br>
<br>
<br>
<br>
</span>
<span class="c10 c1">
Asserts the balance in this commodity<br>
in this account, excluding subaccounts<br>
on this day. Same day events are processed in parse order</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c5">
<span class="c9 c1">
DATE balance ACCOUNT AMOUNT<br>
<br>
2014-08-09 balance Assets:Cash 562.00 USD<br>
2014-08-09 balance Assets:Cash 210.00 CAD<br>
<br>
</span>
<span class="c1">
Asserts the balance in this commodity<br>
in this account, including subaccounts<br>
at the start of this day</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.mjrjnr996vfg-2">
<span>
Balance assignments</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c12 c9 c1">
= AMOUNT (no preceding posting amount)<br>
<br>
2012-03-10 Adjustment<br>
&nbsp; &nbsp;Assets:Cash &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $50<br>
&nbsp; &nbsp;Expenses:Misc</span>
</p>
<p class="c2">
<span class="c9 c1">
<br>
</span>
<span class="c1">
Sets the posting amount so as to make the balance assertion true. (The other amountless posting allows the transaction to balance)</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2 c3">
<span class="c12 c9 c1">
</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c3 c5">
<span class="c12 c9 c1">
</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h4 class="c11" id="h.au5ysr0kfa">
<span class="c19 c31">
Directives</span>
</h4>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2 c3">
<span class="c12 c9 c1">
</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2 c3">
<span class="c12 c9 c1">
</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c5 c3">
<span class="c12 c9 c1">
</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.3v5cafffbbft">
<span class="c7">
account, open </span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c12 c9 c1">
account ACCOUNT</span>
</p>
<p class="c2">
<span class="c9 c1">
&nbsp; &nbsp; [SUBDIRECTIVES]<br>
<br>
account Revenues:Salary<br>
account Expenses:Food:Chicken<br>
&nbsp; &nbsp;note chicken food expenses<br>
&nbsp; &nbsp;alias food<br>
&nbsp; &nbsp;payee ^(KFC|Popeyes)$<br>
&nbsp; &nbsp;check commodity == &quot;$&quot;<br>
&nbsp; &nbsp;assert commodity == &quot;$&quot;<br>
&nbsp; &nbsp;eval print(&quot;Hello!&quot;)<br>
&nbsp; &nbsp;default<br>
<br>
</span>
<span class="c1">
Gives more error checking with </span>
<span class="c9 c1">
--strict</span>
<span class="c1">
&nbsp;or </span>
<span class="c9 c1">
--pedantic<br>
</span>
<span class="c10 c1">
Optional subdirectives do more stuff</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2 c3">
<span class="c9 c1 c12">
</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c5">
<span class="c9 c1">
DATE open ACCOUNT [COMMODITY[,...]] [METHOD]<br>
<br>
2014-05-01 open Assets:Cash USD,CAD<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</span>
<span class="c10 c1">
Every account posted to needs an open directive with prior date</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.22qss13648tb">
<span class="c7">
close</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2 c3">
<span class="c12 c9 c1">
</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2 c3">
<span class="c12 c9 c1">
</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c5">
<span class="c12 c9 c1">
DATE close ACCOUNT</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.n9q16dsjsoye">
<span class="c7">
commodity </span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
commodity COMMODITY<br>
<br>
commodity EUR<br>
commodity $<br>
&nbsp; note American Dollars<br>
&nbsp; format $1,000.00<br>
&nbsp; nomarket<br>
&nbsp; default<br>
<br>
</span>
<span class="c1">
Gives more error checking with </span>
<span class="c9 c1">
--strict</span>
<span class="c1">
&nbsp;or </span>
<span class="c9 c1">
--pedantic<br>
</span>
<span class="c1">
Optional subdirectives do more stuff</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2 c3">
<span class="c12 c9 c1">
</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c5">
<span class="c1 c9">
DATE commodity COMMODITY<br>
&nbsp; &nbsp;[METADATA]<br>
<br>
1867-01-01 commodity CAD<br>
&nbsp; &nbsp;name: &quot;Canadian Dollar&quot;<br>
&nbsp; &nbsp;asset-class: &quot;cash&quot;<br>
<br>
<br>
<br>
</span>
<span class="c10 c1">
Attaches metadata to a commodity</span>
</p>
</td>
</tr>
<tr class="c6">
<td class="c23" colspan="1" rowspan="1">
<h5 class="c11" id="h.wya8r85tgqsx">
<span>
market price</span>
</h5>
</td>
<td class="c4" colspan="1" rowspan="1">
<p class="c2">
<span class="c12 c9 c1">
P DATE TIME COMMODITY UNITPRICE<br>
<br>
P 2004/06/21 02:18:02 AAPL $32.91<br>
P 2004/06/21 02:18:02 AU $400.00</span>
</p>
<p class="c2">
<span class="c9 c1">
<br>
</span>
<span class="c10 c1">
Used by -V and -X<br>
Also set by transaction prices</span>
</p>
</td>
<td class="c16" colspan="1" rowspan="1">
<p class="c2">
<span class="c9 c1">
P DATE COMMODITY UNITPRICE<br>
<br>
P 2015/8/9 GBP $1.55<br>
<br>
<br>
</span>
<span class="c10 c1">
Used by -V</span>
</p>
</td>
<td class="c8" colspan="1" rowspan="1">
<p class="c5">
<span class="c9 c1">
DATE price COMMODITY AMOUNT<br>
<br>
2014-07-09 price USD &nbsp;1.08 CAD<br>
<br>
<br>
</span>
<span class="c10 c1">
Also set by transaction prices</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="c5 c3">
<span class="c9">
</span>
</p>
<p>
<span>
</span>
</p>
<p>
<span>
</span>
</p>
<p>
<span>
</span>
</p>
<p>
<span>
</span>
</p>
<p>
<span>
</span>
</p>
<p>
<span>
</span>
</p>
<p>
<span>
</span>
</p>
<p>
<span>
</span>
</p>
<p>
<span>
</span>
</p>
</div>
</body>
</html>