Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)PR
PracticalReputation @lemmy.world
Posts 3
Comments 3
See expenses in date range monthly for certain day range only
  • Kind of got it as I started thinking about it after posting... Would be better as a oneliner set to an alias so one can add flags on the fly, but this works:

    #!/usr/bin/env bash
    
    # Where to save temporary journal
    PROGRESS_JOURNAL_PATH="/tmp/progress.journal"
    
    # Current month as number
    MONTH=$(date +%m)
    # Need to increment the month with one for loop to work
    ((MONTH++))
    
    # Clean out the temp journal in case it already exists
    echo -e "; Temporary progress journal\n" > "$PROGRESS_JOURNAL_PATH"
    
    for ((COUNTER = 1 ; COUNTER < $MONTH ; COUNTER++)); do
      # Append each months transactions until current month within the same date range as today
      hledger print -b "$(date +%Y)-$COUNTER-01" -e "$(date +%Y)-$COUNTER-$(date +%d)" >> "$PROGRESS_JOURNAL_PATH"
    done
    
    # Print out the command that should run to output
    echo "$ hledger -f $PROGRESS_JOURNAL_PATH is -t -M -A"
    # Get the result
    hledger -f "$PROGRESS_JOURNAL_PATH" is -t -M -A -S
    
  • See expenses in date range monthly for certain day range only

    Is there a way I could see my is view monthly, but from current date from each month? I.e. if I ran the command today I would see January to April where each month is showing expenses and incoming from 1-9, i.e. 1-9 January, 1-9 February, 1-9 March and so forth?

    Idea is to have a comparison how expenses/income ratio is going compared to previous months at the "same time".

    Like for January only I could $ hledger print -b $(date +%Y-)01-01 -e $(date +%Y)-01-$(date +%d)

    2

    Any way to see net instead of gross in Revenue in hledger?

    In hledger I have my income set up like income:job:main (gross) and taxes are in expenses:job:tax, so when I run: $ hledger is -t job I can see my net value for my work and if I run $ hledger is -t other expenses come into play as well.

    Sometimes though, I would like to be able to see the income statement view with my net for my job under Revenues and the rest of my expenses under Expenses. Is there any easy way to do this with an alias or similar?

    2

    Help with parsing this dateformat using hledger

    I have a csv file I'd like to read, seems I'm correct other than parsing the date. The csv file shows the date like so: ""2023-03-04 07:54:33"

    I've tried a bunch without success. I feel it should be:

    date-format %Y-%M-%D %H:%M:%S

    But nope, getting an error it can not parse it.

    2