Commit Graph

3268 Commits

Author SHA1 Message Date
Simon Michael
6ae64c8f3e imp: allow declaring the empty payee name with "" (#2119) 2023-12-07 08:30:55 -10:00
Simon Michael
6a41ed9e64 imp: drop the "a difference of ..." line from balance assertion errors
Rationale:
To satisfy the recentassertions check I'm often filling in a bunch of
placeholder balance assertions, copy/pasting the correct amount from
the balance assertion failure messages. In this situation the
difference just repeats the amount in the line above, with opposite
sign, which makes it harder for me to interpret the message and to
copy-paste the right amount. And more generally I think showing the
difference isn't really necessary.
2023-12-07 07:58:52 -10:00
Simon Michael
1d29540a53 ;doc:csv:matchers: clarify, mention !/& limitation (#2088) 2023-12-07 07:58:52 -10:00
Simon Michael
22ac8d056d fix:print: pad/round amounts with inferred costs like the others (#2123) 2023-12-07 03:41:31 -10:00
Simon Michael
c6a580ff3b fix:import: save each file's latest dates, separately (#2125) 2023-12-07 03:41:31 -10:00
Simon Michael
d1635a55f8 lib: move readFileStrictly to Hledger.Utils.IO 2023-12-07 03:41:31 -10:00
Simon Michael
d831f48cb0 ;doc: update manuals 2023-12-02 09:09:53 -10:00
Simon Michael
ab313c49c7 ;cabal: update cabal files 2023-12-02 09:09:07 -10:00
Simon Michael
80d1da2db9 ;pkg: bump version to 1.32.99 2023-12-02 09:09:07 -10:00
Simon Michael
26f56e0a13 ;doc: changelogs: merge edits from release branch 2023-12-02 09:06:53 -10:00
Simon Michael
e90483a75a ;doc: update manuals 2023-12-01 17:25:00 -10:00
Simon Michael
6cfeb65d7b ;doc: update command help 2023-12-01 17:24:23 -10:00
Simon Michael
71222d75e5 ;doc: changelogs: edit 2023-12-01 17:23:31 -10:00
Simon Michael
0b4b4ed70c ;doc: draft changelogs from commit messages (Shake changelogs) 2023-12-01 17:23:31 -10:00
Simon Michael
938b89ecab ;doc: draft changelogs from TWIH (site/src/news.md) 2023-12-01 17:23:31 -10:00
Simon Michael
f2a7f71a00 ;doc: timedot: example tweak 2023-11-26 08:47:58 -10:00
Simon Michael
3f2e6381ee ;doc: Amount formatting, parseability: improve example 2023-11-26 08:41:20 -10:00
Simon Michael
e66945bc51 ;doc: Amount formatting, parseability: fix link 2023-11-26 08:33:37 -10:00
Simon Michael
0c85b48d2c ;doc: use ``cli not ``shell for command-line examples 2023-11-26 08:30:04 -10:00
Simon Michael
a1988546f1 ;doc: Amount formatting, parseability: fix link 2023-11-26 08:20:59 -10:00
Simon Michael
20ab21e1fa ;doc: Amount formatting, parseability: examples, links 2023-11-26 08:01:57 -10:00
Simon Michael
b6a46f637f feat:timedot: tagged time logging with letters 2023-11-25 21:28:23 -10:00
Simon Michael
6a232e247a ;doc:timedot: cleanups 2023-11-25 21:28:23 -10:00
Simon Michael
4b13af0634 imp:print:beancount: conversion improvements
- omit balance assertions
- replace more currency symbols, and match within symbols like C$
- do more account validation, and error if conversion is too hard
- backslash-escape double quotes and backslashes in payee and note
2023-11-23 01:47:15 -10:00
Simon Michael
0b8e920810 imp:print:beancount: also convert cost amounts 2023-11-22 23:54:10 -10:00
Simon Michael
0bf0c30b8d doc: update manuals 2023-11-22 22:57:55 -10:00
Simon Michael
fcfa7ed78a ;doc: update command help 2023-11-22 22:57:36 -10:00
Simon Michael
a8062381dd ;cabal: update cabal files 2023-11-22 22:57:36 -10:00
Simon Michael
e2cc2d7e24 feat:print: add a basic beancount output format
This prints journal output more likely (but not guaranteed) to
be readable by Beancount.

All packages now require text 1.2.4.1 or greater.
2023-11-22 22:57:36 -10:00
Simon Michael
606d99834a fix: -o/--outputfile with a .json or .sql extension now selects those formats 2023-11-22 19:25:37 -10:00
Simon Michael
f2026aec5a ;doc:commodity directive: edits 2023-11-22 16:27:26 -10:00
Simon Michael
e623df23a3 ;doc:commodity directive: explain why decimal mark is required 2023-11-22 16:23:16 -10:00
Simon Michael
443336033e ;doc: amount formatting: correction, csv does not force . (#2115) 2023-11-22 16:06:33 -10:00
Simon Michael
5cda7c582a ;doc: amount formatting: edits (#2115) 2023-11-22 15:27:41 -10:00
Simon Michael
edf6738109 ;doc: amount formatting: edits (#2115) 2023-11-22 14:49:59 -10:00
Simon Michael
b5fd3c767c ;doc: amount formatting: edits (#2115) 2023-11-22 14:46:50 -10:00
Simon Michael
1744021986 fix: non-print-like reports no longer add trailing decimal marks (fix #2115)
That 1.31 change was advertised as being for the print command only,
but it affected all commands. Now it affects only print and other
"print-like" commands (ie all commands that show whole journal entries
that we might want to re-parse).

Also three classes of hledger output, and how they modify the
commodity display styles' digit group marks and decimal marks
to suit different consumers, have been identified and documented
(under REPORTING CONCEPTS).
2023-11-22 14:22:51 -10:00
Simon Michael
ef2f3e1607 ;doc:csv:if table: clarify, explain why backslash won't work (#2107) 2023-11-21 12:01:28 -10:00
Simon Michael
2b18715885 fix:csv: fix tag: queries on CSV data (#2114) 2023-11-20 21:55:11 -10:00
Simon Michael
4febb74d1e ;doc:journal: decimal marks, commodity directives: rewrites 2023-11-20 10:45:37 -10:00
Simon Michael
fba297f705 imp:import: support -s/--strict properly (fix #2113)
hledger import -s now runs strict checks on an in-memory copy of the
updated journal, before updating the journal file; if strict checks
fail, nothing is written to disk.

And hledger import now does not update any .latest files until it has
run without error (no failing strict checks, no failure while writing
the journal file). This makes it more idempotent, so you can run it
again after fixing problems.
2023-11-16 22:21:05 -10:00
Simon Michael
fa40077ebf ;doc: regular expressions: add examples (hledger_site#224) 2023-11-09 12:04:33 -08:00
Simon Michael
c8484b5792 ;doc: More valuation examples: drop obsolete explanation (precisiongeddon) 2023-11-09 06:19:57 -08:00
Simon Michael
e035730afb imp: roi: limit large decimals to 8 digits by default (precisiongeddon)
With valuation now preserving more decimal digits, roi could show
excessively precise decimals if there was no known display precision
for the valuation commodity. Now in that situation it limits the
precision to a maximum of 8 digits.
2023-11-08 13:59:18 -08:00
Simon Michael
f8ffd9cdda imp: more precision handling fixes, debug output, test updates (precisiongeddon)
This and the preceding commits were "work in progress" that got out of control.
There's more to do, but this one brings these precision-related improvements
(at least):

When "infinite decimals" arise, they are now generally shown with
8 decimal digits rather than 255.

print and prices no longer add trailing decimal zeros unnecessarily.

Some code has been refactored or given more debug output.

All tests have been updated to match the recent changes.
2023-11-08 13:59:18 -08:00
Simon Michael
c51d883162 imp: prices: clarify, fixes, improve semantics (precisiongeddon)
- The prices comand now more accurately lists the prices that hledger
  uses when calculating value reports (similar to what you'd see with
  eg `hledger bal -V --debug=2`).

- The prices command's --infer-reverse-prices flag was confusing since
  we always infer and use reverse prices; it has been renamed to --show-reverse.

- --infer-market-prices and --show-reverse combine properly.

- --show-reverse now ignores all zero prices rather than giving an error.

- Reverse prices (which can be infinite decimals) are now displayed
  with at most 8 decimal digits (rather than the internal precision of
  255 digits).

- Filtering prices by cur: or amt: now works properly.

- Price amounts are styled, but all decimal digits are shown.
2023-11-08 13:59:18 -08:00
Simon Michael
50dc7bebb1 imp: set display style, natural precision on valued amounts (fix #2105, precisiongeddon)
Cost/value conversion now applies the standard display style, and
sets the display precision equal to the internal decimal precision
(or 8 if the decimal appears to be infinite).
This means value reports and especially `print -V` now show amounts
with more accurate and standard style and precision.

New tests have been added describing and explaining various
style/precision behaviours in print cost/value reports.
2023-11-08 13:59:18 -08:00
Simon Michael
a4d3573d29 ;dev: valuation.test: cleanup 2023-11-08 13:50:33 -08:00
Jonathan Dowland
d424966706 ;doc: import: document Match Groups
Add a description of Match Groups to the manual; Section "Matchers".
Include two examples.

Clarify a description of regular expression features with respect
to match groups.

Expand the description of field assignments to cover match group
interpolation, cross-referencing to Section "Matchers" for the full
description.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-11-08 13:49:39 -08:00
Jonathan Dowland
aaf50c165c test: import: functional tests for match group interpolation
Add functional tests for matching substrings in field matchers and
interpolating them into the corresponding field assignments. Check
the following properties and use-cases:

 * Use-case 1: matching a portion of a date in a known format
   (YYY-MM-DD) and writing a comment-command to warp a posting date.
   Useful for credit cards.
 * Use-case 2: match a portion of a CSV field and use it as an
   account assignment. Useful for my byzantine setup with two
   separate ledgers cross-importing to each other.
 * Ensure bracketed portions of field matchers are captured.
 * Ensure bracketed portions of record matchers are captured.
 * Check match token numerical offset is relative to match group,
   not the whole rules file.
 * Check nested matches work.
 * Ensure match group token expansion works with or without
   surrounding text.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-11-08 13:49:39 -08:00