Skip to content

Commit 3f6c400

Browse files
committed
;doc:journal:description/payee/note: clarify
1 parent de3209a commit 3f6c400

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

hledger/hledger.m4.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,16 +1038,34 @@ or reference number.
10381038

10391039
## Description
10401040

1041-
A transaction's description is the rest of the line following the date and status mark (or until a comment begins).
1042-
Sometimes called the "narration" in traditional bookkeeping, it can be used for whatever you wish,
1043-
or left blank. Transaction descriptions can be queried, unlike [comments](#transaction-comments).
1041+
After the date, status mark and/or code fields, the rest of the line (or until a comment is begun with `;`) is the transaction's description.
1042+
Here you can describe the transaction (called the "narration" in traditional bookkeeping),
1043+
or you can record a payee/payer name,
1044+
or you can leave it empty.
1045+
1046+
Transaction descriptions show up in [print](#print) output and in [register](#register) reports,
1047+
and can be listed with the [descriptions](#descriptions) command.
1048+
1049+
You can [query](#queries) by description with `desc:DESCREGEX`,
1050+
or [pivot](#pivoting) on description with `--pivot desc`.
10441051

10451052
### Payee and note
10461053

1047-
You can optionally include a `|` (pipe) character in descriptions to subdivide the description
1048-
into separate fields for payee/payer name on the left (up to the first `|`) and an additional note
1049-
field on the right (after the first `|`). This may be worthwhile if you need to do more precise
1050-
[querying](#queries) and [pivoting](#pivoting) by payee or by note.
1054+
Sometimes people want a dedicated payee/payer field that can be queried and checked more strictly.
1055+
If you want that, you can write a `|` (pipe) character in the description.
1056+
This divides it into a "payee" field on the left, and a "note" field on the right.
1057+
(Either can be empty.)
1058+
1059+
You can query these with `payee:PAYEEREGEX` and `note:NOTEREGEX`,
1060+
list their values with the [payees](#payees) and [notes](#notes) commands,
1061+
or pivot on `payee` or `note`.
1062+
1063+
Note: in transactions with no `|` character, description, payee, and note all have the same value.
1064+
Once a `|` is added, they become distinct.
1065+
(If you'd like to change this behaviour, please propose it on the mail list.)
1066+
1067+
If you want more strict error checking, you can declare the valid payee names with `payee` directives, and then enforce these with `hledger check payees`.
1068+
Note: because of the above, for this you'll need to ensure every transaction description contains a `|` and therefore a checkable payee name (even if it's empty).
10511069

10521070
## Transaction comments
10531071

0 commit comments

Comments
 (0)