Stephen Morgan
07a7c3d3a8
lib: Use Text and Text builder only in postingAsLines.
2021-01-02 15:08:09 +11:00
Stephen Morgan
b9c00dce61
lib,cli,ui: Implement all showMixed* functions in terms of DisplayAmountOpts and WideBuilder.
2021-01-02 15:08:09 +11:00
Stephen Morgan
0a686e220e
lib: Use AmountDisplayOpts for showAmount*, reducing need for many different named functions.
2021-01-02 15:08:09 +11:00
Stephen Morgan
c86e8a9794
lib: Implement showAmountHelper using AmountBuilder.
2021-01-02 15:08:09 +11:00
Stephen Morgan
5dedec83da
lib: showamountquantity shows directly, rather than parsing string output of show instance for Quantity.
2021-01-02 15:08:09 +11:00
Stephen Morgan
f998a791cf
lib: Remove unused optional width argument for StringFormat.
2021-01-02 15:08:09 +11:00
Stephen Morgan
462a13cad7
lib,cli: Use Text Builder for Balance commands.
2021-01-02 15:08:09 +11:00
Stephen Morgan
e3ec01c3c6
lib,cli,ui: Use Text for showDate and related.
2021-01-02 15:08:09 +11:00
Stephen Morgan
74b296f865
lib,cli: Make showTransaction return Text rather than String.
2021-01-02 15:08:09 +11:00
Stephen Morgan
12a6435c51
lib: Add wrap convenience function.
2021-01-02 15:08:09 +11:00
Stephen Morgan
646ee0bce5
cli: Using Text Builder for posting reports.
2021-01-02 15:08:09 +11:00
Damien Cassou
b47d582583
;check: fixes
2020-12-30 18:08:31 -08:00
Simon Michael
3c232fbd7d
check: add "payees" check requiring payee declarations
2020-12-30 18:08:30 -08:00
Stephen Morgan
e406cebcce
lib: Remove unused AtDefault constructor for ValuationType.
2020-12-19 11:59:44 -08:00
Stephen Morgan
cdec0f9382
lib: Remove special handling of now-inaccessible AtDefault valuation constructor.
...
This simplifies all the *ApplyValuation functions, as they no longer
need mreportdate or multiperiod arguments.
2020-12-19 11:59:44 -08:00
Stephen Morgan
439eddc8b9
lib: Include price directives when calculating journal end date.
2020-12-16 19:04:33 -08:00
Stephen Morgan
92645cca14
lib: Sorting accounts by amount should also consider account name after amounts.
2020-12-14 06:48:47 -08:00
Simon Michael
e33667f580
check: support quoted check name + args
...
A "hledger check" argument may now be a quoted string containing
the check name followed by space-separated arguments, for
checks which make use of those. This means the check command
can replicate "check-dates --unique" and (in principle)
"check-fancyassertions ASSERTIONS..". Eg:
hledger check "dates --unique"
I think it'll be better for checks to take no arguments or options,
so this is probably just a transitional feature for compatibility.
2020-11-29 20:48:31 -08:00
Simon Michael
8c23a16bf8
journal: strict mode also requires commodity declarations
2020-11-27 17:54:55 -08:00
Simon Michael
ea0d4901ab
lib: journalApplyAliases performance tweak
2020-11-25 21:06:31 -08:00
Simon Michael
0dc8eca68a
lib: remove partial code from journalApplyAliases etc.
2020-11-25 21:06:31 -08:00
Simon Michael
94b3f090be
csv, timedot, timeclock: respect --alias options ( fix #859 )
...
Command-line account aliases now also affect transactions read
from these formats (not just journal format).
lib: journalApplyAliases, transactionApplyAliases, postingApplyAliases
helpers have been added.
2020-11-24 09:17:01 -08:00
Simon Michael
221a6d9001
lib: new more robust price lookup implementation, fixing #1402
2020-11-23 18:08:41 -08:00
Simon Michael
d60c1f764d
lib: partial valuation fix, more debug output for #1402
2020-11-22 13:10:31 -08:00
Simon Michael
654ab4243a
; comments
2020-11-20 16:45:40 -08:00
Simon Michael
4a74680a22
;lib: rename some budget report helpers
...
The new names are of course verbose, but more consistent and revealing.
2020-11-19 14:59:08 -08:00
Simon Michael
0ce9c352ec
add: don't let number style disturb the default ( Fixes #1378 )
2020-11-14 11:08:01 -08:00
Simon Michael
1f94aa1628
;lib: make file modification/reloading helpers more robust ( #1390 )
...
Work on hledger-web tests showed some bad behaviour, in particular
journalReloadIfNewer would always reload a journal read from a string
or stdout. This is now fixed, and an ugly read.show conversion has
been cleaned up.
Hledger.Cli.Utils API changes:
removed:
- journalSpecifiedFileIsNewer
- fileModificationTime
added:
- utcTimeToClockTime
changed:
- journalFileIsNewer now requires a file argument
2020-11-13 16:28:35 -08:00
Simon Michael
70f95e9f2c
;doc: journal: clarify that it's the first-seen digit group style
2020-11-10 09:29:04 -08:00
Simon Michael
f43c7e41d1
csv, journal: debug output
...
The prolific "assignment" output is now at level 9.
2020-11-10 08:39:32 -08:00
Simon Michael
a97daaf322
lib: replace pretty-show with pretty-simple
...
pretty-simple, already used in .ghci, will hopefully give nicer debug
output, including for values which don't have Read-able Show output.
This should mean that we can start removing custom string-like Show
instances that were a workaround for pretty-show.
We are using the latest version (4.0.0.0) to get compact output.
Here's some old pretty-show output:
CsvRules
{ rdirectives = [ ( "skip" , "1" ) ]
, rcsvfieldindexes = [ ( "date" , 1 ) , ( "amount" , 2 ) ]
, rassignments = [ ( "amount" , "%2" ) , ( "date" , "%1" ) ]
, rconditionalblocks = []
}
And the new pretty-simple output:
CsvRules
{ rdirectives=
[ ( "skip", "1" ) ]
, rcsvfieldindexes=
[ ( "date", 1 ), ( "amount", 2 ) ]
, rassignments=
[ ( "amount", "%2" ), ( "date", "%1" ) ]
, rconditionalblocks= []
}
Non-compact pretty-simple output would be:
CsvRules
{ rdirectives=
[
( "skip"
, "1B"
)
]
, rcsvfieldindexes=
[
( "date"
, 1
)
,
( "amount"
, 2
)
]
, rassignments=
[
( "amount"
, "%2"
)
,
( "date"
, "%1"
)
]
, rconditionalblocks=[]
}
Also:
- Account's Show instance no longer converts : to _ in account names
- drop unused pretty-show dependency from hledger, hledger-ui packages
- regenerate hledger-lib with the older hpack that's shipped in stack
2020-11-10 08:06:11 -08:00
Simon Michael
66af4962a1
;lib: drop a todo, seems ok
2020-11-09 17:14:38 -08:00
Simon Michael
bfb5c6ee2a
lib: global commodity display styles can be set in InputOpts or Journal, overriding all others
2020-11-09 17:14:37 -08:00
Simon Michael
0eddbe7a4b
;lib: reader cleanups
2020-11-09 17:14:37 -08:00
Simon Michael
524e23bc37
csv: decimal-mark rule to help with number parsing
...
Journal keeps a new piece of parsing state, a decimal mark character,
which can optionally be set to force the number format expected by all
amount parsers.
2020-11-08 16:39:03 -08:00
Stephen Morgan
3abc9f5985
lib: When calculating elisions, don't skip over some amounts.
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
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
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
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
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
Stephen Morgan
64e3e5c54d
lib: Improve documentation for StringFormat, remove type alias for Valuation.
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
5a6d38fdf2
lib: For ymd date parsing, don't consume invalid date components.
2020-10-18 21:28:46 -07:00
Simon Michael
08ee311875
journal: fix error when P directive has a zero price ( #1373 )
2020-10-18 20:48:14 -07:00
Simon Michael
c5513ba722
;tweak a few parse errors for clarity, consistency ( #1329 )
2020-09-19 08:10:39 -07:00
Simon Michael
a9fbaaf284
;partial comment cleanups
2020-09-03 09:52:00 -07:00
Simon Michael
c2929939e4
make account type autodetection (& hledger-smooth) case insensitive again ( #1341 )
...
lib: added case-insensitive variants of the accountNameToRegex functions.
2020-09-03 09:52:00 -07:00
Stephen Morgan
07dd30c1e5
lib,cli,ui: Change to consistent naming scheme for Hledger.Utils.Regex.
2020-09-01 11:36:34 +10:00