From 64c212c1f69cc1c5a4ab30a6bdd59495a739f590 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 15 Apr 2016 07:05:25 -0700 Subject: [PATCH] not only the final amount is optional (youam) --- quickref/index.html | 682 +++++++++++++++++++++--------------------- quickref/quickref.css | 6 +- 2 files changed, 344 insertions(+), 344 deletions(-) diff --git a/quickref/index.html b/quickref/index.html index 1a1438f..457e03c 100755 --- a/quickref/index.html +++ b/quickref/index.html @@ -9,30 +9,30 @@ - +
-

+

270px-Rosetta_Stone.JPG

-

+

-

+

Quick Reference for the Ledger-Likes

-

+

Some information about the major Plain Text Accounting  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 - - + + plaintextaccounting.org @@ -40,143 +40,143 @@ plaintextaccounting.org I hope you find it useful.

-

+

First draft, created 2016/03, corrections to: sm on - - + + #hledger  or - - + + #ledger  or - - + + #beancount , or the - - + + google doc

-

+

- - + + Quick Reference for the Ledger-Likes

-

- - +

+ + Journal Format

-

- - +

+ + Basic example

-

- - +

+ + Comments

-

- - +

+ + Basic transactions

-

- - +

+ + Dates

-

- - +

+ + Account names

-

- - +

+ + Amounts

-

- - +

+ + More transaction features

-

- - +

+ + Prices

-

- - +

+ + Balance assertions

-

- - +

+ + Balance assignments

-

- - +

+ + Directives

-

- - +

+ + account, open

-

- - +

+ + close

-

- - +

+ + commodity

-

- - +

+ + market price

-

+

-

+

Journal Format

@@ -186,7 +186,7 @@ Legend :
Things in
- + [ ] are @@ -197,80 +197,80 @@ Some notes in the Ledger column are common to all.

- + - +
- - - + + - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - + - - + - - - - - + - - -
-

- - -

-
-

- -Ledger
-
- - -http://ledger-cli.org/3.0/doc/ledger3.html#Journal-Format - - -
-
- - -http://ricostacruz.com/cheatsheets/ledger.html +

+

+

-

+

+ +Ledger
+
+ + +http://ledger-cli.org/3.0/doc/ledger3.html#Journal-Format + + +
+
+ + +http://ricostacruz.com/cheatsheets/ledger.html + +

+
+

hledger
- - + + http://hledger.org/manual.html#journal

-

+

+

Beancount
- - + + http://furius.ca/beancount/doc/syntax - +
- - + + http://furius.ca/beancount/doc/cheatsheet

-

- +

+

-
+
+
Basic example
-

+

+

; a comment

@@ -287,13 +287,13 @@ Basic example


- + Comments, directives, and/or transactions in any order

-

- +

+

+ ; a comment

2016/1/1 set opening balance
@@ -305,8 +305,8 @@ Comments, directives, and/or transactions in any order
   assets:checking

-

+

+

; a comment

@@ -318,25 +318,25 @@ Comments, directives, and/or transactions in any order
   Assets:Checking         500.00 USD
   Equity:Opening-Balances

-2016/1/5 txn "farmer's market"
+2016-01-05 txn "farmer's market"
   Expenses:Groceries     50 USD
   Assets:Checking

- + All referenced accounts must have an open directive

-
+
+
Comments
-

+

+

; comment
# comment
@@ -345,22 +345,22 @@ Comments
* comment and org-mode outline node

- + Non-comment lines may end with a comment
Indented comments are attached to the preceding transaction or posting

-

- +

+

+ ; comment
# comment
* comment and org-mode outline node

-

+

+

; comment
Any unrecognised line is also a comment
@@ -372,67 +372,67 @@ Any unrecognised line is also a comment

-
+
+
Basic transactions
-

+

+

DATE [DESCRIPTION]
   ACCOUNT    AMOUNT
   ACCOUNT    [AMOUNT]

- + A transaction contains any number of indented postings (usually two), whose amounts must sum to zero
At least two spaces required between account and amount
-The final amount is optional
+One amount may be omitted

-

+

+

DATE [DESCRIPTION]
   ACCOUNT    AMOUNT
   ACCOUNT    [AMOUNT]

- + Same

-

- +

+

-

+

+

DATE txn ["DESCRIPTION"]
   ACCOUNT    AMOUNT
   ACCOUNT    [AMOUNT]

- + DESCRIPTION must be in double quotes, can be multiline
No need for two spaces between account and amount

-
+
+
Dates
-

+

+

YYYY-MM-DD
YYYY/MM/DD
@@ -442,15 +442,15 @@ MM/DD
MM.DD

- + Other formats specified with - +  --input-date-format

-

- +

+

+ YYYY-MM-DD
YYYY/MM/DD
YYYY.MM.DD
@@ -459,8 +459,8 @@ MM/DD
MM.DD

-

+

+

YYYY-MM-DD
YYYY/MM/DD
@@ -470,20 +470,20 @@ YYYY.MM.DD


- + Only YYYY-MM-DD with 8 digits is officially supported

-
- +
+
+ Account names
-

+

+

TOPACCT[:SUBACCT[:...]]

@@ -492,14 +492,14 @@ liabilities:credit card:CITI 1234
other assets:house

- + Account names begin with a letter
May contain single spaces
May contain subaccounts separated by :

-

+

+

TOPACCT[:SUBACCT[:...]]

@@ -508,12 +508,12 @@ TOPACCT[:SUBACCT[:...]]


- + Same

-

+

+

TOPACCT[:SUBACCT[:...]]

@@ -522,24 +522,24 @@ Liabilities:CreditCard:CITI-1234
Assets:House

- + Top level account must be one of Assets, Liabilities, Equity, Income, Expenses
Each subaccount must be capitalised
Letters, digits and hyphen are allowed (no spaces)
- +  

-
- +
+
+ Amounts
-

+

+

One of
COMMODITY QUANTITY
@@ -554,29 +554,29 @@ $10.00


- + COMMODITY is a symbol, word or phrase; if it contains spaces or numbers, it must be in double quotes
It can be on the left or right, with or without a separating space
QUANTITY is a number with 0 or more decimal places
Decimal point is
- + . - +
Digits can be grouped into thousands by
- + , - +
Amount styles influence the standard display style for each commodity

-

- +

+

-

+

+

One of
COMMODITY QUANTITY
@@ -591,34 +591,34 @@ $10.00
12,34,567.89

- + Decimal point is - + . - +  or - + ,
- + Digit group separator is - + , - +  or - + . - +
Any digit grouping can be used, not just thousands

-

- +

+

-

+

+

QUANTITY COMMODITY

@@ -633,38 +633,38 @@ QUANTITY COMMODITY


- + COMMODITY is all capital letters, on the right, and required
- + Decimal point is - + . - +
Digit group separator
- + , - +  is allowed and ignored

-
- +
+
+ More transaction   - + features
-

+

+

DATE [FLAG] [(CODE)] DESCRIPTION
   [FLAG] ACCOUNT  AMOUNT [PRICE] [=BAL]
@@ -672,23 +672,23 @@ DATE [FLAG] [(CODE)] DESCRIPTION
   [FLAG] ACCOUNT  [AMOUNT [PRICE] [=BAL]]

- + FLAG (aka STATE) is empty, ! or * meaning uncleared, pending or cleared
CODE is any string, in parentheses
DESCRIPTION can be a payee name, narration, or both

-

- +

+

+ DATE [FLAG] [(CODE)] DESCRIPTION
   [FLAG] ACCOUNT  AMOUNT [PRICE] [=BAL]
   ...
   [FLAG] ACCOUNT  AMOUNT [PRICE] [=BAL]

-

+

+

DATE [txn|FLAG] [["PAYEE"] "DESCRIPTION"]
   [FLAG] ACCOUNT       AMOUNT [PRICE]
@@ -696,24 +696,24 @@ DATE [txn|FLAG] [["PAYEE"] "DESCRIPTION"]
   [FLAG] ACCOUNT       AMOUNT [PRICE]

- + The txn keyword may be replaced by a FLAG
For just a payee, use "PAYEE" ""
- +  

-
- +
+
+ Prices
-

+

+

One of
@ UNITPRICE
@@ -725,13 +725,13 @@ and/or
[LOTDATE]

- + A UNITPRICE or TOTALPRICE also records a market price on this date
A LOTDATE is written in square brackets

-

+

+

One of
@ FIXEDUNITPRICE
@@ -743,13 +743,13 @@ and/or


- + These do not record market prices
The lot price syntax is ignored

-

+

+

{LOTUNITPRICE[ / LOTDATE]}
and/or one of
@@ -760,21 +760,21 @@ and/or one of


- + Lot prices are remembered and form distinct commodities, other prices are not
If there is both a lot price and a regular price, the latter records a market price

-
- +
+
+ Balance assertions
-

+

+

= AMOUNT (after posting amount & price)

@@ -783,14 +783,14 @@ Balance assertions
   Assets:Cash       $-20 = $80

- + Asserts the balance in this commodity
in this account, excluding subaccounts
at this point in the parse order

-

+

+

= AMOUNT (after posting amount & price)

@@ -799,14 +799,14 @@ at this point in the parse order


- + Asserts the balance in this commodity
in this account, excluding subaccounts
on this day. Same day events are processed in parse order

-

+

+

DATE balance ACCOUNT AMOUNT

@@ -815,67 +815,67 @@ DATE balance ACCOUNT AMOUNT


- + Asserts the balance in this commodity
in this account, including subaccounts
at the start of this day

-
+
+
Balance assignments
-

- -= AMOUNT (no preceding posting amount)
+

+

+ += AMOUNT (no preceding/inferred posting amount)

2012-03-10 Adjustment
   Assets:Cash            = $50
   Expenses:Misc

-

+


- + Sets the posting amount so as to make the balance assertion true. (The other amountless posting allows the transaction to balance)

-

- +

+

+

-

- +

+

+

-

- +

+

+ Directives

-

- +

+

+ KEYWORD ARGS...
   [SUBDIRECTIVES]

account

-

- +

+ alias
apply
assert
@@ -891,8 +891,8 @@ fixed
include
P

-

- +

+ payee
tag
test
@@ -905,8 +905,8 @@ b
h

-

+

+

KEYWORD ARGS...

@@ -938,9 +938,9 @@ include

-

- +

+

+ [DATE] KEYWORD ARGS...
   [SUBDIRECTIVES]

@@ -969,19 +969,19 @@ pushtag

-
- +
+
+ account, open
-

- +

+

+ account ACCOUNT

-

+

    [SUBDIRECTIVES]

@@ -996,27 +996,27 @@ account Expenses:Food:Chicken
   default

- + Gives more error checking with --strict - +  or --pedantic
- + Optional subdirectives do more stuff

-

- +

+

+

-

+

+

DATE open ACCOUNT [COMMODITY[,...]] [METHOD]

@@ -1031,46 +1031,46 @@ DATE open ACCOUNT [COMMODITY[,...]] [METHOD]


- + Every account posted to needs an open directive with prior date

-
- +
+
+ close
-

- - -

-
-

- +

+

-

- +

+

+ + +

+
+

+ DATE close ACCOUNT

-
- +
+
+ commodity
-

+

+

commodity COMMODITY

@@ -1082,27 +1082,27 @@ commodity $
  default

- + Gives more error checking with --strict - +  or --pedantic
- + Optional subdirectives do more stuff

-

- +

+

+

-

+

+

DATE commodity COMMODITY
   [METADATA]
@@ -1114,37 +1114,37 @@ DATE commodity COMMODITY


- + Attaches metadata to a commodity

-
+
+
market price
-

- +

+

+ P DATE TIME COMMODITY UNITPRICE

P 2004/06/21 02:18:02 AAPL $32.91
P 2004/06/21 02:18:02 AU $400.00

-

+


- + Used by -V and -X
Also set by transaction prices

-

+

+

P DATE [TIME] COMMODITY UNITPRICE

@@ -1152,13 +1152,13 @@ P 2015/8/9 GBP $1.55


- + Used by -V
A time is ignored

-

+

+

DATE price COMMODITY AMOUNT

@@ -1166,15 +1166,15 @@ DATE price COMMODITY AMOUNT


- + Also set by transaction prices

-

- +

+

diff --git a/quickref/quickref.css b/quickref/quickref.css index 8f4677c..030ce0a 100644 --- a/quickref/quickref.css +++ b/quickref/quickref.css @@ -5,9 +5,9 @@ tr { /* update these class ids on each save */ p { margin:0; } p.c36 { visibility:hidden; } -p.c32 { margin-left:1em; } -p.c5 { margin-left:3em; } -p.c31 { margin-left:2em; } +p.c35 { margin-left:1em; } +p.c14 { margin-left:3em; } +p.c28 { margin-left:2em; } /* heading cells */ tr:first-child { font-weight:bold;