You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hledger/hledger.m4.md
+25-7Lines changed: 25 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1038,16 +1038,34 @@ or reference number.
1038
1038
1039
1039
## Description
1040
1040
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`.
1044
1051
1045
1052
### Payee and note
1046
1053
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).
0 commit comments