In Amount, aismultiplier is a boolean flag that will always be False, except for in TMPostingRules, where it indicates whether the posting rule is a multiplier. It is therefore unnecessary in the vast majority of cases. This posting pulls this flag out of Amount and puts it into TMPostingRule, so it is only kept around when necessary. This changes the parsing of journals somewhat. Previously you could include an * before an amount anywhere in a Journal, and it would happily parse and set the aismultiplier flag true. This will now fail with a parse error: * is now only acceptable before an amount within an auto posting rule. Any usage of the library in which the aismultiplier field is read or set should be removed. If you truly need its functionality, you should switch to using TMPostingRule. This changes the JSON output of Amount, as it will no longer include aismultiplier.
112 lines
2.2 KiB
Plaintext
112 lines
2.2 KiB
Plaintext
<
|
|
2019-1-1
|
|
(a) 1.0 AAA
|
|
|
|
# 1. Test the json output for register reports
|
|
$ hledger -f- reg --output-format=json
|
|
[
|
|
[
|
|
"2019-01-01",
|
|
null,
|
|
"",
|
|
{
|
|
"paccount": "a",
|
|
"pamount": [
|
|
{
|
|
"acommodity": "AAA",
|
|
"aprice": null,
|
|
"aquantity": {
|
|
"decimalMantissa": 10,
|
|
"decimalPlaces": 1,
|
|
"floatingPoint": 1
|
|
},
|
|
"astyle": {
|
|
"ascommodityside": "R",
|
|
"ascommodityspaced": true,
|
|
"asdecimalpoint": ".",
|
|
"asdigitgroups": null,
|
|
"asprecision": 1
|
|
}
|
|
}
|
|
],
|
|
"pbalanceassertion": null,
|
|
"pcomment": "",
|
|
"pdate": null,
|
|
"pdate2": null,
|
|
"poriginal": null,
|
|
"pstatus": "Unmarked",
|
|
"ptags": [],
|
|
"ptransaction_": "1",
|
|
"ptype": "VirtualPosting"
|
|
},
|
|
[
|
|
{
|
|
"acommodity": "AAA",
|
|
"aprice": null,
|
|
"aquantity": {
|
|
"decimalMantissa": 10,
|
|
"decimalPlaces": 1,
|
|
"floatingPoint": 1
|
|
},
|
|
"astyle": {
|
|
"ascommodityside": "R",
|
|
"ascommodityspaced": true,
|
|
"asdecimalpoint": ".",
|
|
"asdigitgroups": null,
|
|
"asprecision": 1
|
|
}
|
|
}
|
|
]
|
|
]
|
|
]
|
|
|
|
# 2. Test the json output for balance reports
|
|
$ hledger -f- bal --output-format=json
|
|
[
|
|
[
|
|
[
|
|
"a",
|
|
"a",
|
|
0,
|
|
[
|
|
{
|
|
"acommodity": "AAA",
|
|
"aprice": null,
|
|
"aquantity": {
|
|
"decimalMantissa": 10,
|
|
"decimalPlaces": 1,
|
|
"floatingPoint": 1
|
|
},
|
|
"astyle": {
|
|
"ascommodityside": "R",
|
|
"ascommodityspaced": true,
|
|
"asdecimalpoint": ".",
|
|
"asdigitgroups": null,
|
|
"asprecision": 1
|
|
}
|
|
}
|
|
]
|
|
]
|
|
],
|
|
[
|
|
{
|
|
"acommodity": "AAA",
|
|
"aprice": null,
|
|
"aquantity": {
|
|
"decimalMantissa": 10,
|
|
"decimalPlaces": 1,
|
|
"floatingPoint": 1
|
|
},
|
|
"astyle": {
|
|
"ascommodityside": "R",
|
|
"ascommodityspaced": true,
|
|
"asdecimalpoint": ".",
|
|
"asdigitgroups": null,
|
|
"asprecision": 1
|
|
}
|
|
}
|
|
]
|
|
]
|
|
|
|
>=0
|