Simon Michael
5e0a35b1da
fix:journal:P directives: require a space after the symbol [ #2280 ]
...
This prevents surprising parses, like
`P 2024-10-31 a0 1` parsed as `P 2024-10-31 a 01`.
2024-11-02 15:24:25 -10:00
Simon Michael
d6080c5ff1
imp: check commodities: also check commodities used in P directives [ #2280 ]
2024-11-02 15:03:57 -10:00
Simon Michael
c66e901d8b
dev: save the parse positions of PriceDirectives
2024-11-02 15:00:47 -10:00
Simon Michael
4d38c63ec8
dev: move/rename nullsourcepos
2024-11-02 14:59:43 -10:00
Simon Michael
5d2259d942
dev: Hledger.Utils.IO: cleanup
2024-11-02 12:59:44 -10:00
Simon Michael
1dabccfb46
dev: Hledger.Utils.IO: more cleanup
2024-11-02 12:51:53 -10:00
Simon Michael
4351304f06
dev: Hledger.Utils.IO: cleanup
2024-11-02 12:04:19 -10:00
Simon Michael
9c81bb2a06
dev: Hledger.Utils.IO colour helpers: cleanup
2024-11-02 11:54:28 -10:00
Simon Michael
75ff6c8218
;cabal: update cabal files
2024-11-02 08:42:10 -10:00
Simon Michael
657fc1551f
!fix: respect --color=yes in a few places that didn't; drop text-ansi dep
...
Hledger.Utils.IO's ansi style/color helpers now respect --color=yes,
so that eg `hledger --color=yes | less -R` shows bold headings as
you'd expect.
Hledger.Utils.IO.rgb' now takes Float arguments instead of Word8.
2024-11-01 10:40:25 -10:00
Simon Michael
234b4879c2
imp: less pager will use HLEDGER_LESS instead, if defined
...
When using `less` as pager, if HLEDGER_LESS is defined, it will
provide the options (instead of LESS + hledger's extra options).
You can set your own preferred options here, or you can set it
equal to LESS to use exactly those options.
[#2272 ]-related
2024-11-01 08:02:03 -10:00
Simon Michael
5bab9600e4
imp: simplify pager setup: just customise LESS, not MORE
...
[#2272 ]-related
2024-11-01 08:01:44 -10:00
Simon Michael
1011029356
imp: pager set extra LESS options for a nice experience when using less
...
Currently this sets a rather ambitious set of options,
and overrides the existing LESS:
--chop-long-lines
--hilite-unread
--ignore-case
--mouse
--no-init
--QUIT-AT-EOF
--quit-if-one-screen
--RAW-CONTROL-CHARS
--squeeze-blank-lines
--use-backslash
--use-color
2024-10-31 19:13:39 -10:00
Simon Michael
30086ae249
imp: run pager more robustly; drop pager lib [ #2272 ]
...
This fixes the error displayed when quitting the pager with long output.
It also replaces the pager lib with more robust homegrown pager utilities,
which should prevent a number of failure modes.
2024-10-31 18:55:09 -10:00
Simon Michael
659e493b30
;doc: update changelogs
2024-10-30 19:01:49 -10:00
Simon Michael
50bf401ea6
dev: split debug/ghcdebug flags, comment out the latter for now
...
Compilation with ghc-debug is failing, and it has not yet been used
for anything. Separate the flag and leave it in place but commented for now.
2024-10-24 10:44:28 -10:00
Henning Thielemann
1a9bfcf5be
cli: Commands.Aregister: implement --invert option
2024-10-23 21:55:24 -10:00
Henning Thielemann
3714ac0593
lib: Write.Ods.printFods: change type of number of fixed rows/columns from (Maybe Int) to Int
...
0 is a perfect value for no fixed row or column.
2024-10-22 12:05:42 -10:00
Simon Michael
d985e89bad
imp: default V accounts become just E when a new V account is declared
...
The equity:conversion account, and its variations equity:trade(s) and equity:trading,
normally detected as V/Conversion type, now become ordinary E/Equity accounts
if some other account is declared as V/Conversion type.
This is motivated by the next commit, in which `check accounts` will
stop warning about conversion accounts and their subaccounts,
which means all of the above names and their subaccounts would remain
always exempt from strict account checking.
Now, if the user declares their own conversion account, those default
accounts will become controllable by account checking again.
Which at least reduces the allowlist a bit.
Hopefully this won't cause hassles.
2024-10-20 09:13:58 -10:00
Simon Michael
da11d74ae6
dev: refactor: clarify journalAccountTypes
2024-10-20 09:13:58 -10:00
Simon Michael
e44cbbf1a4
dev: refactor, clarify detection of cost/conversion postings
2024-10-20 09:13:58 -10:00
Simon Michael
2d90550e25
dev: cleanups
2024-10-20 09:13:58 -10:00
Henning Thielemann
4c189dde32
lib: Write.Spreadsheet.integerCell: for transaction indices
2024-10-20 08:49:36 -10:00
Simon Michael
f8cc9cdb4d
;dev: document runPager's behaviour precisely
2024-10-20 08:10:07 -10:00
Simon Michael
5bf48d721a
cabal: update cabal files
2024-10-19 18:50:40 -10:00
Simon Michael
7325b75d5b
imp: rename ghcdebug build flag to debug, and enable stack traces with it
...
Builds made with ghc 9.10+ and the 'debug' build flag, will show
(some kind of, partial) stack traces when the program ends with an
error. (And also will have ghc-debug support enabled.)
The stack traces will probably improve in due course.
2024-10-19 18:47:03 -10:00
Simon Michael
f5b10b2d40
dev: cleanups
2024-10-19 16:56:14 -10:00
Henning Thielemann
8b391e2a07
cli: Commands.Print: add export to FODS and HTML
...
use common Spreadsheet framework for CSV export, too
2024-10-19 16:52:54 -10:00
Simon Michael
b940254025
imp:cli: detect --color more safely in most cases
...
--color now also works in a config file, like --pager, except for two
cases: it does not affect colouring of debug output, or the colouring
helpers used in the check recentassertions error message.
2024-10-19 16:28:36 -10:00
Simon Michael
711d921774
imp:cli: --no-pager -> --pager, make this and --color safe options
2024-10-19 16:28:36 -10:00
Simon Michael
3e48451c3f
imp: note unsafe args / config file limitation; make --no-pager safe
2024-10-19 16:28:36 -10:00
Simon Michael
ba786752d1
imp 📟 add a --no-pager general flag
2024-10-19 16:28:36 -10:00
Simon Michael
db748465a8
fix 📟 when the $PAGER is not in PATH, print instead of failing
2024-10-19 16:28:36 -10:00
Simon Michael
4441680d7b
fix:lib:Hledger.Utils.IO.pager: avoid a crash; avoid an extra newline
2024-10-19 16:28:36 -10:00
Simon Michael
3b7420b97c
feat: use a pager for all large terminal output, not just for help
2024-10-19 16:28:36 -10:00
Henning Thielemann
96e0500ea7
cli: Commands.Register.postingsReportItemAsRecord: format transaction index as integer
...
lib: Write.Spreadsheet.Type: new TypeInteger
2024-10-18 00:07:11 -10:00
Henning Thielemann
b23753f5ae
cli: Commands.Register.postingsReportItemAsRecord: export amounts as number plus commodity
...
lib: Write.Spreadsheet.cellFromMixedAmount, cellsFromMixedAmount: taken from Cli.Balance
2024-10-18 00:07:11 -10:00
Henning Thielemann
d7b713f958
lib: Write.Ods.styleNames: common generation of ODS style names for both formatCell and cellConfig
2024-10-18 00:07:11 -10:00
Henning Thielemann
fe53b9b6ee
lib: Write.Ods: disambiguate style names for DataMixedAmount and DataString (bugfix)
2024-10-18 00:07:11 -10:00
Henning Thielemann
991c56caef
cli: Commands.Register.postingsReportAsSpreadsheet: generalize CSV output to HTML and FODS
2024-10-18 00:07:11 -10:00
Simon Michael
0f7aaa9600
imp: check accounts: simplify confusing suggestion in error message, 2
2024-10-16 21:19:51 -10:00
Simon Michael
1fa8b79640
;doc: update manuals
2024-10-15 16:36:54 -10:00
Simon Michael
6bd5012b9b
;doc: changelogs
2024-10-15 16:36:54 -10:00
Simon Michael
36d1093b84
imp: check accounts: simplify confusing suggestion in error message
2024-10-15 16:36:54 -10:00
Henning Thielemann
9d1ba5c588
cli: CompoundBalanceCommand.compoundBalanceReportAsSpreadsheet: common function for CSV, HTML, FODS export
2024-10-14 20:59:51 -10:00
Simon Michael
71a7879213
fix:check tags: _price-matched -> _cost-matched, and whitelisted [ #2247 ]
2024-10-14 14:49:18 -10:00
Henning Thielemann
b8497c830e
lib: Write.Spreadsheet.headerCell, addRowSpanHeader, rawTableContent: taken from Commands.Balance
2024-10-14 11:35:12 -10:00
Simon Michael
2a374668e4
dev: Write.Beancount: isUpperCase -> isUpper to support ghc < 9.6
2024-10-14 11:02:21 -10:00
Simon Michael
aff3cd0591
imp:print:beancount: more robust conversion of commodity names
2024-10-11 14:56:03 -10:00
Simon Michael
4eff3ed8a0
;cabal: update cabal files
2024-10-11 14:56:03 -10:00
Simon Michael
6dd9c92d32
lib: add Hledger.Data.Currency, currencySymbolToCode, currencyCodeToSymbol
2024-10-11 14:56:03 -10:00
Simon Michael
5f92fbd99a
;cabal: update cabal files
2024-10-10 23:25:07 -10:00
Simon Michael
66fce53c0b
dev: extract beancount output helpers to Hledger.Write.Beancount
2024-10-10 23:25:07 -10:00
Simon Michael
21a84fb336
fix: calculate value correctly when P amounts have few decimal digits [ #2254 ]
...
Valuation in another commoditay could sometimes be inaccurate if the P
price amounts did not have enough decimal places.
2024-10-08 23:11:57 -10:00
Simon Michael
4e6f6611a6
dev: fix DisplayName's off-by-one indent value, noted in #2246
...
Now displayIndent (and prrIndent) 0 means no indent, 1 means one
indent step, etc.
2024-10-08 23:11:57 -10:00
Simon Michael
6ce5e85e99
dev: clarify: rename displayDepth/prrDepth to displayIndent/prrIndent
...
These are about indentation for rendering, not account depth;
these are not always directly related, eg when boring parents are elided.
2024-10-08 23:11:57 -10:00
Simon Michael
8c71d071d7
imp:print:beancount:convert account names more robustly; better errors
2024-10-03 23:19:32 -10:00
Simon Michael
f54805a034
;doc: update changelogs
2024-10-03 04:47:50 -10:00
Simon Michael
1c45496f1c
dev: web: fix build with ghc <9.2
2024-09-30 17:20:13 -10:00
Simon Michael
e157bb4a6b
dev: Hledger.Write.Ods: fix build with ghc <9.6
2024-09-30 17:20:13 -10:00
Simon Michael
6773e92361
dev: Hledger.Write.Ods: follow global-then-local-imports convention
2024-09-30 17:20:13 -10:00
Simon Michael
bb551bf0dc
;doc: update changelogs
2024-09-30 17:20:13 -10:00
Simon Michael
c92b601028
dev: fix warnings with ghc 9.10 / base 4.20
...
Older ghc versions should also still build cleanly (tested with 9.8 so far).
I don't like enabling CPP in so many modules but it's easier that
figuring out how to do it with base-compat; hopefully no noticeable
compilation impact.
2024-09-30 17:20:13 -10:00
Simon Michael
1b60ebb61f
;cabal: update cabal files
2024-09-30 17:20:13 -10:00
Simon Michael
6225ac8a22
imp!: support ghc 9.10 / base 4.20
...
When built with ghc 9.10.1, hledger error messages are displayed
with an extra newline following them.
https://gitlab.haskell.org/ghc/ghc/-/issues/25116
2024-09-30 17:15:59 -10:00
Simon Michael
cc7ba473ec
imp: bal: html output will use a hledger.css file, like bs/cf/is
2024-09-29 21:22:38 -10:00
Henning Thielemann
5565f11c73
cli: Commands.Balance.multiBalanceReportAsSpreadsheetHelper: vertically merge cells showing account names and Total
...
lib: Write.Spreadsheet: add support for cell spans
2024-09-29 19:25:05 -10:00
Simon Michael
2cbea889f5
dev: lib: fix package.yaml, regen .cabal [ #2244 ]
2024-09-29 13:27:51 -10:00
Henning Thielemann
2f9a8031b0
lib: Write.Html -> Write.Html.Lucid
...
Write.Html: keep common definitions for both HTML backends
2024-09-29 13:27:51 -10:00
Henning Thielemann
cc7e034d64
lib: Write.Html.Blaze: alternative to Lucid based export
...
for compatibility with hledger-web/yesod
2024-09-29 13:27:51 -10:00
Henning Thielemann
d8fc30f7c5
lib: Write.Html.Attribute.tableStyle: style definitions taken from Commands.Balance.multiBalanceReportAsHtml
...
avoid duplicate with Write.Html.printHtml
Write.Html.Attribute: remove dependency on Lucid
2024-09-29 13:27:51 -10:00
Henning Thielemann
499c626e48
lib: Write.Spreadsheet: support for anchors in HTML and FODS export
...
cli: Commands.Balance: new option --base-url
It adds hledger-web-compatible hyperlinks to account names.
2024-09-28 22:12:51 -10:00
Simon Michael
823be7c565
fix: csv: tags on following lines, and posting dates, also work now [ #2241 ]
...
Follow-on work from #2214 .
2024-09-28 18:54:43 -10:00
Simon Michael
b28468e651
dev: clarify some confusing comment parsers a bit [ #2241 ]
2024-09-28 18:53:46 -10:00
Henning Thielemann
6ce6c72fd4
lib: Write.Html.Attributes: extracted HTML output helpers from Cli.Commands.Balance
2024-09-24 22:51:30 -10:00
Henning Thielemann
441f46fc06
lib: Tabular.AsciiWide.renderRs: simplify using flattenHeader
2024-09-24 20:50:54 -10:00
Simon Michael
9589941bb4
;doc: update changelogs
2024-09-17 07:20:27 -07:00
Henning Thielemann
ff397f79cc
lib: Write.Spreadsheet.Cell: add cellClass field for HTML style class
...
cmd: Commands.Balance.multiBalanceRowAsCellBuilders: add HTML style class attributes here
This way we do not need to dissect table rows in
multiBalanceReportHtmlHeadRow, multiBalanceReportHtmlBodyRow, multiBalanceReportHtmlFootRow
Eventually removed these three functions.
2024-09-11 13:51:09 -07:00
Henning Thielemann
55c1246598
cli: Commands.Balance.budgetReportAsSpreadsheet: also transpose border
2024-09-11 13:51:09 -07:00
Henning Thielemann
2ed13afed4
lib: Write.Spreadsheet: support for borders like in existing HTML export
...
cli: Commands.Balance: use for FODS export and balance and budget export to HTML
2024-09-11 13:51:09 -07:00
Simon Michael
30aeb662f2
doc: update manuals
2024-09-09 14:09:28 -07:00
Simon Michael
27e6eb0024
;cabal: update cabal files
2024-09-09 14:06:06 -07:00
Simon Michael
c079725836
;pkg: bump version to 1.40.99
2024-09-09 14:06:06 -07:00
Simon Michael
5cbbdb4670
imp: reg --sort: show supported keys in help and error message [ #2211 ]
2024-09-09 14:04:43 -07:00
Simon Michael
3b73360584
;doc: update changelogs
2024-09-09 14:04:43 -07:00
Simon Michael
dda3855ba2
;cabal: update cabal files
2024-09-09 14:04:43 -07:00
Simon Michael
eaa494a4cb
;pkg: allow doclayout 0.5
2024-09-09 14:04:43 -07:00
Simon Michael
979c387663
;doc: changelogs: 1.40
2024-09-09 14:04:08 -07:00
Michael Rees
e34fa491af
Add abs implementation for MixedAmount
2024-09-05 11:56:07 +01:00
Michael Rees
52253c01f6
Add absamount as --sort field for register
2024-09-05 11:56:07 +01:00
Michael Rees
693360344c
Add desc/description as possible sort field
2024-09-05 11:56:07 +01:00
Michael Rees
25bcf3eebb
;Don't apply sort spec when only sorting by date
...
If there is no sort spec given, then the postings are already sorted by
date, so there's no need to apply the default sort spec again.
2024-09-05 11:56:07 +01:00
Michael Rees
275c72b770
; Use defsortspec everywhere instead of hard-coding default
2024-09-05 11:56:07 +01:00
Michael Rees
b429f57afb
Show error message on conflicting --sort and -H
2024-09-05 11:56:07 +01:00
Michael Rees
b4a9f87fe4
Move SortSpec to Hledger.Reports.ReportOptions
...
As part of this migration, I also switched from using Data.List.splitOn
to Hledger.Utils.splitAtElement.
2024-09-05 11:56:07 +01:00
Michael Rees
00eb0aa16b
feat: register: add --sort as in ledger
2024-09-05 11:56:07 +01:00
Simon Michael
3fbad1892d
dev: rename some Intervals for clarity [ #2218 ]
2024-09-04 16:07:54 +01:00
Simon Michael
038ebd8c7a
fix: three more interval start date cases; add tests; cleanup [ #2218 ]
2024-09-04 16:07:54 +01:00
Simon Michael
c8b6ca7b70
fix: 'every Nth day of month from DATE' start date [ #2218 ]
2024-09-04 16:07:54 +01:00
Simon Michael
6fc117fa15
;cabal: update cabal files [ #2213 ]
2024-08-29 23:20:39 +01:00