;csv: doc: another currency clarification, posting fields cleanup
[ci skip]
This commit is contained in:
parent
b475ad039a
commit
d4cddc5402
@ -96,24 +96,24 @@ Here are the standard hledger field names:
|
|||||||
Most often there are two postings, so you'll want to set `account1` and `account2`.
|
Most often there are two postings, so you'll want to set `account1` and `account2`.
|
||||||
<!-- (Often, `account1` is fixed and `account2` will be set later by a [conditional block](#if).) -->
|
<!-- (Often, `account1` is fixed and `account2` will be set later by a [conditional block](#if).) -->
|
||||||
|
|
||||||
A number of field/pseudo-field names are available for setting posting [amounts](journal.html#amounts):
|
`amountN` sets posting N's amount. Or, `amount` with no N sets posting 1's.
|
||||||
|
Or if the CSV has debits and credits in separate fields, you can use
|
||||||
|
`amountN-in` and `amountN-out`, or `amount-in` and `amount-out` with
|
||||||
|
no N for posting 1.
|
||||||
|
|
||||||
- `amountN` sets posting N's amount
|
For convenience and backwards compatibility, if you set the amount of
|
||||||
- `amountN-in` and `amountN-out` can be used instead, if the CSV has separate fields for debits and credits
|
posting 1 only, a second posting with the negative amount will be
|
||||||
- `currencyN` sets a currency symbol to be left-prefixed to the amount, useful if the CSV provides that as a separate field
|
generated automatically.
|
||||||
- `balanceN` sets a (separate) [balance assertion](journal.html#balance-assertions) amount
|
|
||||||
(or when no posting amount is set, a [balance assignment](journal.html#balance-assignments))
|
|
||||||
|
|
||||||
If you write these with no number
|
If the CSV has the currency symbol in a separate field, you can use
|
||||||
(`amount`, `amount-in`, `amount-out`, `currency`, `balance`),
|
`currencyN` to prepend it to posting N's amount. `currency` with no N
|
||||||
it means posting 1.
|
affects ALL postings.
|
||||||
Also, if you set an amount for posting 1 only,
|
|
||||||
a second posting that balances the transaction will be generated automatically.
|
`balanceN` sets a separate [balance assertion](journal.html#balance-assertions) amount
|
||||||
This helps support CSV rules created before hledger 1.16.
|
(or if the posting amount is left empty, a [balance assignment](journal.html#balance-assignments)).
|
||||||
<!-- XXX check exact behaviour, eg in three-posting example below -->
|
|
||||||
|
|
||||||
Finally, `commentN` sets a [comment](journal.html#comments) on the Nth posting.
|
Finally, `commentN` sets a [comment](journal.html#comments) on the Nth posting.
|
||||||
Comments can of course contain [tags](journal.html#tags).
|
Comments can also contain [tags](journal.html#tags), as usual.
|
||||||
|
|
||||||
## `(field assignment)`
|
## `(field assignment)`
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user