Commit Graph

9059 Commits

Author SHA1 Message Date
Stephen Morgan
166951dc69 bal: Sort amounts after negating when using invert_ (#1283, #1379) 2020-11-05 10:35:47 -10:00
Simon Michael
cd0c76eb4a ;bal: tests related to #1379 2020-11-05 10:35:47 -10:00
Simon Michael
c54971f3a2 ;bal: clean up, simplify sorting tests (#1283, #1379)
- update emacs outline config
- drop test numbers
- drop separate tabular/non-tabular tests, it's now the same code
- fix some misplaced tree/flat-specific comments
- remove redundant >=
2020-11-05 10:35:47 -10:00
Simon Michael
03c1193e54 ;changelog tweak 2020-11-04 21:10:45 -10:00
Simon Michael
d1ded6fd84 ;update changelogs 2020-11-04 06:52:15 -10:00
Stephen Morgan
83a518af99 lib,cli,ui: In ReportOpts, store query terms term-by-term in a list in
querystring_.

This helps deal with tricky quoting issues, as we no longer have to make
sure everything is quoted properly before merging it into a string.
2020-11-04 08:47:30 -08:00
Simon Michael
c010a6df48 benchmarks: add some large (140, 1400 columns) tabular reports 2020-11-03 17:30:10 -10:00
Stephen Morgan
3abc9f5985 lib: When calculating elisions, don't skip over some amounts. 2020-11-04 14:25:21 +11:00
Stephen Morgan
6d7bd9e475 lib: Implement concat(Top|Bottom)Padded in terms of renderRow, allowing them to be width aware. 2020-11-04 14:25:21 +11:00
Stephen Morgan
a620ab9666 lib: Expand Tabular.AsciiWide to allow multiline cells, either top or bottom aligned. 2020-11-04 14:25:21 +11:00
Stephen Morgan
dcb884c5ff lib: Align postings to unnormalised amount widths. 2020-11-04 14:25:20 +11:00
Stephen Morgan
0bebda7313 lib,cli,ui: Elide amounts to a width of 32 characters, rather than 22 characters. 2020-11-04 14:25:20 +11:00
Stephen Morgan
7e47c11fda lib: Remove some uses of pad(Left|Right)Wide to ensure we're using the
width provided by showMixed.

Also refactor renderTable to be a bit clearer, and to avoid duplicate
calculations.
2020-11-04 14:25:20 +11:00
Stephen Morgan
e9a16edb58 cli: Use new mixed amount display functions for balance format strings. 2020-11-04 14:25:20 +11:00
Stephen Morgan
b39de5989f lib: Refactor and improve comments for new mixed amount display functions. 2020-11-04 14:25:20 +11:00
Stephen Morgan
9de238757b lib,cli,ui: Introduce showMixed*Unnormalised, eliminate most direct calls of strWidth.
This introduces some new helper functions which are exactly the same
as what we had before, but do not call
normaliseMixedAmountSquashPricesForDisplay, so that we can use the new
functions for displaying Transaction and Posting. It also goes through
and gets rid of most uses of the old showMixed* functions which would
benefit from using the new interface.
2020-11-04 14:25:20 +11:00
Stephen Morgan
a838366c9d cli: Ensure register reports are correctly aligned for negative numbers.
This uses the new showMixed* function for the register report. This
fixes some misaligned negative numbers which appeared in one of the
earlier commits, and adds a test for it.
2020-11-04 14:25:20 +11:00
Stephen Morgan
162a936360 lib: BudgetReport uses new renderTable inteface, now has more compact output.
This changes showMixedAmountElided so that the width to elide to is
given as an argument, rather than fixed at 22 characters. This
actually uses the new renderTable interface. Mostly this is just an
internal change, but since we have more information about the widths
of things, we can actually get rid of some superfluous spaces in the
budget report output, previously there to make sure it stayed aligned
with the largest reasonable contents.
2020-11-04 14:25:20 +11:00
Stephen Morgan
33369dfa6c lib: renderTable can now receive alignment and width specifications on all cells, and has an option to display the outer border.
This gives renderTable a little more customisation. Before any of the
commits of this PR, render would just receive a string to display in
each cell. After the second commit of this PR it would also receive a
width of the string (in place of stripping ANSI sequences and then
calculating the width). After this commit, it now also takes an
alignment, so you can make cells left or right aligned. The function
render calls renderTable with appropriate options to give the same
behaviour as before. Also, previously render would always put a border
around the table. We would take this output, and would sometimes strip
the border by dropping the first and last rows, and first and last
characters of every row. I've just added an option to control whether
to put the border in, so we can just not add it in the first place,
rather than stripping it later. Note that this is again just defining
helper functions; this extra power is not yet used anywhere.
2020-11-04 14:25:20 +11:00
Stephen Morgan
a2b7a03fc4 lib,cli: bal uses new amount display functions, no longer needs to strip ansi. 2020-11-04 14:25:20 +11:00
Stephen Morgan
e50a8c0f34 lib: Refactor Text.Tabular.AsciiWide to allow custom width specification in rendering. 2020-11-04 14:25:20 +11:00
Stephen Morgan
57d7b223a2 lib: Write new showMixedAmount* functions which keep track of length.
Previously showMixedAmountElided would show two amounts and then the
elision string if necessary. Now it will display as many Amounts as it
can subject to the condition that the amounts plus the elision string
fit within 22 characters.
2020-11-04 14:25:20 +11:00
Simon Michael
73b7d8813c make bench: run just three slowest commands 2020-11-03 08:20:24 -10:00
Simon Michael
56a9ed6d66 tools: use pretty-simple for ghci output 2020-11-03 08:19:01 -10:00
Simon Michael
cca8802e2c ;update changelogs 2020-11-03 08:18:14 -10:00
Simon Michael
b10e96d26d ;update manuals 2020-10-25 18:56:34 -10:00
Simon Michael
6e956fb62b ;csv: doc: tweak (#1089) 2020-10-25 18:56:22 -10:00
Simon Michael
8b97d31db4 ;update manuals 2020-10-25 18:50:37 -10:00
Simon Michael
d42070ee87 ;csv: doc: rewrite currency tip (#1089) 2020-10-25 18:50:37 -10:00
Stephen Morgan
db97fae348 lib: Add documentation for CBCSubreportSpec. 2020-10-23 16:15:41 -07:00
Stephen Morgan
795134777c lib: Add Functor instance for CompoundPeriodicReport. 2020-10-23 16:15:41 -07:00
Stephen Morgan
affc8d10f2 lib: Generalise CBCSubreportSpec to allow more subreport control. 2020-10-23 16:15:41 -07:00
Stephen Morgan
6e65d4e071 lib: Export some MultiBalanceReport helper functions. 2020-10-23 16:15:41 -07:00
Stephen Morgan
c5abefc72f lib: Add documentation for ReportSpec. 2020-10-23 14:14:11 -07:00
Stephen Morgan
260283e2f1 lib,cli,ui,web: Introduce ReportSpec, which holds ReportOpts, the day of
the report, and the parsed Query.
2020-10-23 14:14:11 -07:00
Stephen Morgan
19ab222599 lib,cli: Remove old impure ReportOpts date functions. 2020-10-23 14:14:11 -07:00
Stephen Morgan
2aaab4b1b7 lib: Make Default instances clearer, remove Default instance for Bool. 2020-10-23 14:14:11 -07:00
Stephen Morgan
ff0c5bc743 lib,ui: Store the original query string in ReportOpts, provide a function for regenerating ReportOpts. 2020-10-23 14:14:11 -07:00
Stephen Morgan
64e3e5c54d lib: Improve documentation for StringFormat, remove type alias for Valuation. 2020-10-23 14:14:11 -07:00
Stephen Morgan
1171c23eee lib,cli,ui: Ensure ReportOpts always has today_ set. 2020-10-23 14:14:11 -07:00
Stephen Morgan
fcbe511d42 ui,web: Adopt new ReportOptions interface, store literal query string in UIOpts. 2020-10-23 14:14:11 -07:00
Stephen Morgan
efc9758f82 lib: Make sure reportspan doesn't interfere with correctly determining valuation date. 2020-10-23 14:14:11 -07:00
Stephen Morgan
c45663d41d lib,cli: Store parsed Query in ReportOpts, rather than an unparsed
String.
2020-10-23 14:14:11 -07:00
Stephen Morgan
103308e795 lib,cli: Store StringFormat in ReportOpts, rather than unparsed String.
StringFormat now also takes an optional overline width, which is
currently only used by defaultBalanceLineFormat.
2020-10-23 14:14:11 -07:00
Stephen Morgan
f76cdc4317 lib: Remove checkReportOpts and checkRawOpts.
checkRawOpts has been a no-op for at least four years, and
checkReportOpts only makes sure that depth_ is positive, which is taken
care of by the maybeposintopt parser.
2020-10-23 14:14:11 -07:00
TANIGUCHI Kohei
906da6e6bd Fix hledger-web description
Slashes need to be escaped or they introduce unexpected italic style
due to Haddock markup.
2020-10-22 00:33:47 -07:00
Simon Michael
291a35d8b4 ;lib: refactor 2020-10-19 09:09:38 -07:00
Simon Michael
2761324404 journal: apply commodity styles to forecasted transactions (#1371) 2020-10-19 08:59:25 -07:00
Simon Michael
831ec0dcf0 ;lib: refactor journalAddForecast 2020-10-19 08:52:00 -07:00
Simon Michael
fe5a97be81 ;ci: mac: try 8.10 to avoid no symbol warnings 2020-10-18 23:04:03 -07:00