price directives after the last transaction/posting date if using
--value=end.
Also enlarges the reportspan to encompass full intervals for budget
goals.
- Consume list immediately in commodityStylesFromAmounts.
This and/or the other strictness fixes below reduce memory and time
usage, a lot, for journals with many @@ total prices.
- Include sign in TotalPrice in Amount, rather than relying on the sign of aquantity.
Journal entries still require a positive @@ price, but now the sign is
set after parsing, rather than when converting in amountToCost.
The reason for this change is that, if we're going to perform arithmetic
on Amount with TotalCost, then the presence of aquantity=0 means that
amountToCost would render the total cost as 0, because signum 0 == 0.
This makes amount arithmetic more consistent, and allows negative
prices to be represented. It also means that total prices override
the primary amount: 0A @@ 1B is now 1B, not 0.
- Make fields of Amount, AmountPrice, AmountStyle, and DigitGroupStyle
strict.
- Distinguish between an Amount having quantity (or rounded quantity 0),
and having both quantity and totalprice 0 (or rounded to 0).
- normaliseHelper now uses a strict Map for combining amounts
internally, closing a big space leak.
This also now combines Amounts with TotalPrices in the same commodity
when normalising; amounts with TotalPrices were previously never
combined.
- (amount|mixedAmount)(Looks|Is)Zero functions now check whether both
the quantity and the cost are zero. This is usually what you want, but
if you do only want to check whether the quantity is zero, you can run
mixedAmountStripPrices (or similar) before this.
both the quantity and the cost are zero. This is usually what you want,
but if you do only want to check whether the quantity is zero, you
can run mixedAmountStripPrices (or similar) before this.
(multiply|divide)(Mixed)?Amount now also multiply or divide the
TotalPrice if it is present, and the old
(multiply|divide)(Mixed)?AmountAndPrice functions are removed.
internally, closing a big space leak.
This also now combines Amounts with TotalPrices in the same commodity
when normalising; amounts with TotalPrices were previously never
combined.
aquantity.
Journal entries still require a positive @@ price, but now the sign is
set after parsing, rather than when converting in amountToCost.
The reason for this change is that, if we're going to perform arithmetic
on Amount with TotalCost, then the presence of aquantity=0 means that
amountToCost would render the total cost as 0, because signum 0 == 0.
This makes journal entries like the following impossible to balance:
2000-01-01
a 0 @@ 10 A
b -10 A
If you forget that the argument is required by the --match
option, and not the command as a whole - eg if instead of
hledger print --match somebank -x
you write:
hledger print --match -x somebank
that gets quietly parsed as:
hledger print --match="-x"
which is not great. Adding --debug now at least gives some insight:
hledger print --match -x somebank --debug
finding best match for description: "-x"
similar transactions:
...
add --debug=1 shows the top hits for similar past transactions.
added:
Hledger.Cli.Utils.journalSimilarTransaction
provides --debug=1 output
changed:
Hledger.Cli.Commands.Add.transactionsSimilarTo -> Hledger.Data.Journal.journalTransactionsSimilarTo
now takes an extra number-of-results argument
It would not add the tag when a comment already existed.
This affected hledger-print-location.hs and probably
the generated-transaction: tag in periodic transactions.
For clarity; infer-value was too vague. The old spelling remains
supported for compatibility, but is now deprecated.
When typing, --infer-market or even --infer (for now) is sufficient.
On the accounts screen and register screen we round amounts according
to commodity styles, but when you drill down to a transaction you
probably want to see the unrounded amounts.