Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register report alignment question #2285

Open
yongli-abc opened this issue Nov 11, 2024 · 6 comments
Open

Register report alignment question #2285

yongli-abc opened this issue Nov 11, 2024 · 6 comments
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. journal The journal file format, and its features. register

Comments

@yongli-abc
Copy link

Hi there, I notice that the Register output is aligning matching account names and amounts at different positions. Is this a alignment issue, or does that actually have any significance?

Couldn't really find anywhere in the documentation about this.

Example
image

@simonmichael
Copy link
Owner

Very unusual! Could you try to reduce it to a minimal reproducing example ?

@simonmichael simonmichael added A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. register labels Nov 11, 2024
@yongli-abc
Copy link
Author

Here's a test.journal

2023-11-10 Crv*giffgaff, London
    liabilities:credit card:barclaycard avios plus          £-8.00
    expenses:housing:utility:phone                           £8.00
2024-01-02 OCTOPUS ENERGY        A-93A7A16B-001	FIRST D
    assets:bank:barclays:current                 £-50.00
    expenses:housing:utility:electricity          £50.00

Here's the report

hledger register acct:utility -f ~/tmp/test.journal
2023-11-10 Crv*giffgaff, London                              expenses:housing:utility:phone                            £8.00         £8.00
2024-01-02 OCTOPUS ENERGY        A-93A7A16B-001 FIRST D       expenses:housing:utility:electricity                     £50.00        £58.0
0

The second account name already has an extra space in front, making it appear like indented.

@simonmichael
Copy link
Owner

What kind of terminal environment are you running in ? Can you try some others ?

@simonmichael
Copy link
Owner

@yongli-abc I see the problem: there's a tab character before FIRST D, which confuses the layout algorithm.

I'm not sure if this is a bug.

@simonmichael
Copy link
Owner

simonmichael commented Nov 12, 2024

I'm curious how the tab characters came to be there ? Are they part of your bank data ? Was it originally tab-separated values ?

Here are some options for what we can do:

  1. allow it, document it
  2. reject it as an error. Could be awkward if bank data contains tabs.
  3. convert tabs to 1, 2 or 4 spaces when parsing
  4. convert tabs to 1, 2 or 4 spaces when rendering text output for register, aregister, maybe print, etc.

@yongli-abc
Copy link
Author

Hi, thanks for looking into this. Yes it's part of the journal postings, but I'm not sure how it gets there. I've manually cleared up all the tabs in my journal file, but I think 3 or 4 both make sense!

@simonmichael simonmichael added A-WISH Some kind of improvement request, hare-brained proposal, or plea. journal The journal file format, and its features. and removed A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. labels Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. journal The journal file format, and its features. register
Projects
None yet
Development

No branches or pull requests

2 participants