hledger/hledger-lib/Hledger/Data
Stephen Morgan cf25d7d56d
imp: bal: more predictable sort order with multiple commodities (#1563, #1564)
This change provides more predictable and intuitive behaviour when 
using -S/--sort-amount with multiple commodities. 
It implements a custom Ord (and Eq) instance for MixedAmount 
which substitutes zero for any missing commodities.

As a consequence, all the ways of representing zero with a MixedAmount ([],
[A 0], [A 0, B 0, ...]) are now Eq-ual (==), whereas before they were
not. We have not been able to find anything broken by this change.

* imp: lib: Compare MixedAmounts by substituting zero for any missing commodities. (#1563)
* ;doc: Update docs for new multicommodity sort by amount rules.
2021-07-12 21:11:50 -10:00
..
Account.hs lib,cli,ui,bin: Remove unnecessary normalisedMixedAmount, replace 2021-05-01 09:45:29 -10:00
AccountName.hs lib,cli,ui,web: Remove unnecessary CPP when dropping support for GHC 8.2. 2021-06-07 17:33:54 -10:00
Amount.hs imp: bal: more predictable sort order with multiple commodities (#1563, #1564) 2021-07-12 21:11:50 -10:00
Commodity.hs lib,cli,ui,web: Remove unnecessary CPP when dropping support for GHC 8.2. 2021-06-07 17:33:54 -10:00
Dates.hs lib,cli,ui: Use Text for showDate and related. 2021-01-02 15:08:09 +11:00
Journal.hs lib: clarify journalEndDate, add journalLastDay 2021-07-12 18:50:06 -10:00
Json.hs lib,cli,ui,web: Remove unnecessary CPP when dropping support for GHC 8.2. 2021-06-07 17:33:54 -10:00
Ledger.hs lib,cli: Fix ledgerDateSpan, so that in takes transaction dates into account. 2021-04-03 13:54:23 -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,ui,web: Remove unnecessary CPP when dropping support for GHC 8.2. 2021-06-07 17:33:54 -10:00
Posting.hs imp: bal: more predictable sort order with multiple commodities (#1563, #1564) 2021-07-12 21:11:50 -10: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,ui,web: Remove unnecessary CPP when dropping support for GHC 8.2. 2021-06-07 17:33:54 -10:00
Transaction.hs lib: export transactionCheckBalanced (#1596) 2021-07-07 13:20:13 -10:00
TransactionModifier.hs lib: Auto-postings with Amount queries should filter only those commodities which match the query. 2021-07-01 09:35:56 -10:00
Types.hs imp: bal: more predictable sort order with multiple commodities (#1563, #1564) 2021-07-12 21:11:50 -10:00
Valuation.hs lib: Remove unused (amount|mixedAmount|posting|transaction)ApplyCostValuation functions. 2021-05-07 22:25:19 +10:00