hledger/hledger-lib/Hledger/Data
Stephen Morgan 2ada289e28 lib: 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 journal entries like the following impossible to balance:
2000-01-01
    a  0 @@ 10 A
    b  -10 A
2021-02-23 14:54:39 -08:00
..
Account.hs lib: Make consistent naming scheme for showMixedAmount* functions, 2021-01-02 15:08:09 +11:00
AccountName.hs lib,cli,ui: Replace some uses of String with Text, get rid of some unpacks, clean up showMixed options. 2021-01-02 15:08:09 +11:00
Amount.hs lib: Include sign in TotalPrice in Amount, rather than relying on the sign of 2021-02-23 14:54:39 -08:00
Commodity.hs new price search that really finds the shortest path (#1443) 2021-01-04 18:42:51 -08:00
Dates.hs lib,cli,ui: Use Text for showDate and related. 2021-01-02 15:08:09 +11:00
Journal.hs lib: Consume list immediately in commodityStylesFromAmounts. 2021-02-23 14:54:39 -08:00
Json.hs cli: Using Text Builder for posting reports. 2021-01-02 15:08:09 +11:00
Ledger.hs lib,cli,ui,web: Make Regexp a wrapper for Regex. 2020-08-31 12:04:45 +10:00
Period.hs lib,cli,ui: Use Text for showDate and related. 2021-01-02 15:08:09 +11:00
PeriodicTransaction.hs lib,cli: Make showTransaction return Text rather than String. 2021-01-02 15:08:09 +11:00
Posting.hs ;lib: commentAddTagNextLine was broken 2021-02-12 13:56:02 -08:00
RawOptions.hs check: support quoted check name + args 2020-11-29 20:48:31 -08:00
StringFormat.hs lib: Remove unused optional width argument for StringFormat. 2021-01-02 15:08:09 +11:00
Timeclock.hs lib,cli: Assorted fixes for older GHC. 2021-01-02 15:08:09 +11:00
Transaction.hs lib: Include sign in TotalPrice in Amount, rather than relying on the sign of 2021-02-23 14:54:39 -08:00
TransactionModifier.hs lib: Use Text and Text builder only in postingAsLines. 2021-01-02 15:08:09 +11:00
Types.hs ;lib: document AmountPrecision 2021-02-05 16:09:49 -08:00
Valuation.hs cli: rename --infer-value to --infer-market-price 2021-02-05 15:16:39 -08:00