Commit Graph

1614 Commits

Author SHA1 Message Date
Simon Michael
86a91c514d lib: disallow prices in balance assertions/assignments (fix #824)
(and in Ledger-style {=FIXEDLOTPRICES} )
2019-01-05 07:35:54 +00:00
Simon Michael
6f36702141 lib: rename, reposition tprecedingcomment field 2019-01-05 07:35:54 +00:00
Simon Michael
cd1455e9ea lib: note aquantity zero with AUTO amounts 2019-01-05 07:35:54 +00:00
Simon Michael
5908414d77 lib: amultiplier -> aismultiplier 2019-01-05 07:35:54 +00:00
Simon Michael
3b0cb701ac lib: reorder Amount fields for clearer debug output 2019-01-05 07:35:54 +00:00
Simon Michael
40713ee7aa update embedded manuals 2018-12-02 17:26:18 -08:00
Simon Michael
67d7c82e9f bump version to 1.12 2018-12-02 17:20:34 -08:00
Simon Michael
2e525f5600 lib: accountdirectivep: update unit tests 2018-12-02 16:41:16 -08:00
Simon Michael
552783a06b doc: journal: rewrite balance assertions doc a little 2018-12-02 16:22:28 -08:00
Simon Michael
2d51cef88e doc: changelogs 2018-12-02 13:29:00 -08:00
Jesse Rosenthal
11a5809c5c journal: improve unassignable error. 2018-12-02 13:29:00 -08:00
Jesse Rosenthal
07d0a003a3 journal: fill unassignable list from account names. 2018-12-02 13:29:00 -08:00
Jesse Rosenthal
597b1b8ccd journal: check assignments against unassignable list 2018-12-02 13:29:00 -08:00
Jesse Rosenthal
ff455689a3 journal: add new state field for unassignable accounts
This should eventually include accountnames from transaction
modifiers (if `--auto` is enabled), or periodic transactions (if
`--forecast` is enabled).
2018-12-02 13:29:00 -08:00
Simon Michael
df775326d9 lib: add disabled test for proposed #931 solution 2018-11-29 13:44:38 -08:00
Simon Michael
6d0ee6a590 lib: clarify what postingsAsLines does (#931) 2018-11-29 13:32:59 -08:00
Simon Michael
e06e300446 lib: try to pin down what isTransactionBalanced does (#931) 2018-11-29 13:14:49 -08:00
Simon Michael
b2b25d2523 doc: changelogs: tweak descriptions 2018-11-25 21:06:33 -08:00
Simon Michael
a2faa8dfbf journal: doc: move multicommodity assertions doc to right place 2018-11-25 21:05:55 -08:00
Alex Chen
e4cc6f31b9 lib: update periodic transaction entry in journal docs
- also specify the starting date in the example periodic transaction so
  that it lies on the first day of the week (it otherwise does not
  parse)
2018-11-22 14:09:32 -08:00
Alex Chen
83a63a4ef5 lib: minor cleanup in 'periodictransactionp' 2018-11-22 14:09:32 -08:00
Alex Chen
519297051d lib: restore previous period expression parser behaviour (PR #807)
- parse a period expression by first extracting words separated by
  single spaces, then by "re-parsing" this text with 'periodexprp'
- this way, the period expression parsers do not need to know about
  the single- or double-space rules
2018-11-22 14:09:32 -08:00
Alex Chen
880e6e0a32 lib: add a custom parse error for "re-parsing"
- for pretty-printing parse errors thrown from the parsing of excerpts
  of the source text as if they were thrown from the parsing of the
  source text itself
2018-11-22 14:09:32 -08:00
Simon Michael
a711ae60fb journal: doc: more detail on transaction modifiers (#928)
[ci skip]
2018-11-13 18:15:51 -08:00
Simon Michael
b00aa32d7b journal: txn modifier multipliers multiply total-priced amounts (#928)
A different approach: instead of converting to unit prices and fiddling
with the display precision, just multiply the total prices by the same
multiplier (and keep them positive).

This seems a little more natural. I'm not sure if one of these will be
more robust than the other.
2018-11-13 17:50:30 -08:00
Simon Michael
d7919003ae lib: (divide|multiply)[Mixed]AmountAndPrice (#928)
Divide/multiply amounts *and* their total price, if they have one.
Helpful for keeping transactions balanced when transaction modifiers are
multiplying amounts.
2018-11-13 17:43:15 -08:00
Simon Michael
b053942e9b lib: flip the arguments of (divide|multiply)[Mixed]Amount (api change)
Also, start using a mapMixedAmount helper.
2018-11-13 17:28:24 -08:00
Simon Michael
9e8b1612b0 journal: fix txn modifier multipliers with total-priced amounts (#928)
Transaction modifier multipliers have never multiplied total-priced amounts
correctly (and prior to hledger 1.10, this could generate unbalanced
transactions).

Now, the generated postings in this situation will have unit prices,
and an extra digit of display precision. This helps ensure that
the modified transaction will remain balanced. I'm not sure yet if
it's guaranteed.
2018-11-13 16:35:46 -08:00
Simon Michael
4b5b9f46db lib: TransactionModifier: clarify 2018-11-13 16:35:46 -08:00
Simon Michael
80b34ea48d lib: TransactionModifier: cleanup 2018-11-13 11:25:36 -08:00
Mykola Orliuk
99bfebd1a1 ui: support all results of showGenericSourcePos
Resolves simonmichael/hledger#904
2018-10-26 16:32:16 -07:00
Peter Simons
027d084878 Drop undecidable Ord instance for ParseError.
That code fails to compile with ghc-8.6.1 because the instance is undecidable.
I suppose we could enable the appropriate compiler extension to support it, but
I've found that simply removing the instance causes no problems whatsoever: the
entire repository still compiles fine and it passes all test suites, too.
2018-10-24 10:35:11 -07:00
Peter Simons
4e8f2c11d3 Allow building with base-4.12.
The build succeeds just fine and all test suites pass, too.
2018-10-24 10:35:11 -07:00
Mykola Orliuk
1aac38d3d3 lib: include source info in txn balance errors
Partially address simonmichael/hledger#904
2018-10-23 15:54:38 -07:00
Simon Michael
3f6922b51f lib: showTransaction: comment
[ci skip]
2018-10-22 14:28:18 -07:00
Samuel May
e57ef9e9a9 lib: journal: Add support for exact assertions 2018-10-22 09:55:14 -07:00
Samuel May
6c31393dd3 lib: Groundwork allowing multi-commodity assertions 2018-10-22 09:55:14 -07:00
Samuel May
cde91fc5f4 lib: Make BalanceAssertion a full datatype
Note: simplifies/moves whitespace parsing out of the balance assertion
parser.
2018-10-22 09:55:14 -07:00
Simon Michael
0d531bb24f lib: showTransaction: fix a case showing multiple missing amounts
Noticed by peti: showTransaction could sometimes hide the last posting's
amount even if one of the other posting amounts was already implcit,
producing invalid transaction output.
2018-10-22 07:23:40 -07:00
Simon Michael
b5a90432ff lib: document and test showTransaction*, posting*AsLines 2018-10-22 06:46:31 -07:00
Simon Michael
20f006f7f6 lib: transaction: drop commented code 2018-10-22 04:03:29 -07:00
Simon Michael
80dc2ef03f update cabal files with hpack 0.31
As in latest stack release. Hopefully this won't unleash horrors.
2018-10-18 14:44:16 -07:00
Simon Michael
b5df5fb5f0 lib: comment 2018-10-18 14:43:00 -07:00
Simon Michael
74611a7be1 ui: accounts: fix balances when there's only periodic txns
And clarify multiBalanceReport.
2018-10-18 14:43:00 -07:00
Simon Michael
2c2d10f9c2 lib: plog, plogAt: add missing newline, note issue 2018-10-18 14:43:00 -07:00
Jesse Rosenthal
a6a73e36e3 Finish removing journalFinalise (#903)
* journal: Get rid of `journalFinalise` and use granular functions

Complete the process started in 53b3e2bd. This gets rid of the
`journalFinalise` function and uses the smaller steps, in order to
have more granular control.

* journal: Change order of operations in finalization

We want to make sure that we add the filepath after the order is
reversed, so the added filepath is on the head and not the tail (as it
would be if it were reversed after it was added).

* journal: Refine granular finalization functions

This commit fixes two of the granular finalization functions:

1. Rename `journalSetTime` to `journalSetLastReadTime` and improve
   documentation.

2. Remove `journalSetFilePath`. It's redundant with `journalAddFile`
   currently in `Hledger.Read.Common`. The only difference between the
   functions is where the file is added (we keep the one in which it
   is added to the tail), so we change the position vis-a-vis
   reversal.
2018-10-16 08:51:51 -07:00
Simon Michael
0f2a31bea7 docs: journal: account: a little bit more about sorting
[ci skip]
2018-10-15 12:07:44 -07:00
Simon Michael
4a399e50cb acc: don't require an explicit --flat to make --drop work 2018-10-13 13:22:11 -07:00
Simon Michael
b72f9697a2 lib: journal: account: allow whitespace or a comment after the account name 2018-10-13 13:09:49 -07:00
Simon Michael
4f2d9dde4c docs: journal: clarify transaction modifiers
[ci skip]
2018-10-12 09:12:06 -07:00