hledger/hledger-lib/Hledger/Data
Stephen Morgan 8eedbbbe87 imp: cost: Generate totally balanced conversion postings for amounts with costs.
Introduce --infer-equity option which will generate conversion postings.
--cost will override --infer-equity.

This means there will no longer be unbalanced transactions, but will be
offsetting conversion postings to balance things out. For example.

2000-01-01
  a   1 AAA @@ 2 BBB
  b  -2 BBB

When converting to cost, this is treated the same as before.
When used with --infer-equity, this is now treated as:

2000-01-01
  a                               1 AAA
  equity:conversion:AAA-BBB:AAA  -1 AAA
  equity:conversion:AAA-BBB:BBB   2 BBB
  b                              -2 BBB

There is a new account type, Conversion/V, which is a subtype of Equity/E.
The first account declared with this type, if any, is used as the base account
for inferred equity postings in conversion transactions, overriding the default
"equity:conversion".

API changes:

Costing has been changed to ConversionOp with three options:
NoConversionOp, ToCost, and InferEquity.
The first correspond to the previous NoCost and Cost options, while the
third corresponds to the --infer-equity flag.  This converts transactions with costs
(one or more transaction prices) to transactions with equity:conversion postings.
It is in ConversionOp because converting to cost with -B/--cost and inferring conversion
equity postings with --infer-equity are mutually exclusive.

Correspondingly, the cost_ record of ReportOpts has been changed to
conversionop_.

This also removes show_costs_ option in ReportOpts, as its functionality
has been replaced by the richer cost_ option.
2021-12-21 10:50:13 -10:00
..
Account.hs cln: Add explicit export list for Hledger.Data.Account. 2021-09-18 11:41:53 -10:00
AccountName.hs dev: Use realLength from doclayout instead of strWidth and textWidth. (#895) 2021-11-11 18:29:50 -10:00
Amount.hs imp: cost: Generate totally balanced conversion postings for amounts with costs. 2021-12-21 10:50:13 -10:00
Balancing.hs pkg: progress towards supporting GHC 9.2 and newer libs (#1774) 2021-12-06 12:32:50 -10:00
Dates.hs pkg: Drop base-compat-batteries dependency. 2021-10-31 07:56:07 -10:00
Journal.hs imp: cost: Generate totally balanced conversion postings for amounts with costs. 2021-12-21 10:50:13 -10:00
Json.hs lib!: Remove GenericSourcePos, and replace it with either SourcePos or 2021-09-20 08:38:33 -10:00
Ledger.hs cln: tests: Remove test and tests, which are just aliases for testCase 2021-08-30 16:32:19 -10:00
Period.hs fix!: register: Tighten up spacing around the date in register reports. (#1655) 2021-08-22 08:15:22 -10:00
PeriodicTransaction.hs pkg!: Remove Hledger.Utils.UTF8IOCompat module. 2021-08-30 15:57:33 -10:00
Posting.hs imp: cost: Generate totally balanced conversion postings for amounts with costs. 2021-12-21 10:50:13 -10:00
RawOptions.hs cln: hlint: Clean up list related hlint warnings. 2021-08-27 06:13:56 -10:00
StringFormat.hs pkg: Drop base-compat-batteries dependency. 2021-10-31 07:56:07 -10:00
Timeclock.hs lib!: Remove GenericSourcePos, and replace it with either SourcePos or 2021-09-20 08:38:33 -10:00
Transaction.hs imp: cost: Generate totally balanced conversion postings for amounts with costs. 2021-12-21 10:50:13 -10:00
TransactionModifier.hs pkg: progress towards supporting GHC 9.2 and newer libs (#1774) 2021-12-06 12:32:50 -10:00
Types.hs imp: cost: Generate totally balanced conversion postings for amounts with costs. 2021-12-21 10:50:13 -10:00
Valuation.hs imp: cost: Generate totally balanced conversion postings for amounts with costs. 2021-12-21 10:50:13 -10:00