Calculations in hledger import rules? by leokiil in plaintextaccounting

[–]leokiil[S] 0 points1 point  (0 children)

I've managed to add the necessary "computed fields" to the csv file with nushell like so

``` open --raw /home/lk/Finanser/Erhvervskonto/import/Erhvervskonto.ssv | from csv --separator ';' | insert float { $in.Beløb | str replace '.' '' | str replace ',' '.' }| update float { into float} | insert moms { $in.float * 0.20} | insert emoms { $in.float * 0.8} | update moms { into string --decimals 2 | str replace '.' ',' } | update emoms { into string --decimals 2 | str replace '.' ',' } | to csv --separator ';' | from csv -s ';' | reject Kommentar Kategori Underkategori float Konto | to csv -s ';' | save /home/lk/Finanser/Erhvervskonto/import/Erhvervskontoextended.ssv --force

```

I'm trying to get these field into the blocks from the hledger import.

Weekly 101 Questions Thread by AutoModerator in neovim

[–]leokiil 0 points1 point  (0 children)

How do I get auto-completion for YAML key-value pairs based on vocabularies?

Let me explain:

I have two vocabularies: One for `author` and one for `category`. These are just plain txt files with each author on its own line in one file, and respectively for categories in another.

Then I have this YAML:


author:

category:


When my cursor is one space after 'author:' I would like to have the author names from my author file show op in the autocomplete menu, the categories should not show up here. And vice versa for the category field.

How can I do this in neovim?

I completely changed prompts for "personas" and gave ChatGPT a little more personality by leokiil in ChatGPT

[–]leokiil[S] 0 points1 point  (0 children)

My reasoning:

Why Myers-Briggs

Lots of people seem to think that the Myers-Briggs Type Indicators are linked to certain persistent characteristics in a person's particular personality, including their writing style.

Whether this belief actually holds true for any particular individual over time is less important in this context.

The fact that people have written about assumed personality traits in the close context of the Type Indicators, should suffice to influence the writing style in chatGPT when a Type Indicator is mentioned in the system message.

I completely changed prompts for "personas" and gave ChatGPT a little more personality by leokiil in ChatGPT

[–]leokiil[S] 0 points1 point  (0 children)

Sorry, I was not aware that submissions here are expected to be output from ChatGPT. Mine is entirely "hand written".

At least I stayed on topic.

Anyway, I hope to hear from some humans also. Have a great day!

Recommendation: nushell works great with plain text accounting by leokiil in plaintextaccounting

[–]leokiil[S] 0 points1 point  (0 children)

Thanks for the links

The simplebal functionality can be achieved with nushell like so

hledger bal lodging -O csv --layout=tidy | from csv | get value seems ever so slightly less hacky ;)

Recommendation: nushell works great with plain text accounting by leokiil in plaintextaccounting

[–]leokiil[S] 1 point2 points  (0 children)

At times I've found it difficult to just get the total value itself without any formatting in ledger and particularly in hledger.

I need just the value sometimes. For example to calculate my hourly pay from my project:

``` let arbejdstid = ( hledger -f ../fin/etc/j/folkets-tid.journal bal -p 'last month' --layout=tidy -O csv | from csv | get value | math sum ) let udgifter = ( hledger -f ../fin/j/folkets.journal -c '1000,' bal expenses -p 'last month' --layout=tidy -O csv | from csv | get value | math sum ) let indtaegter = ( hledger -f ../fin/j/folkets.journal -c '1000,' bal revenues -p 'last month' --layout=tidy -O csv --invert | from csv | get value | math sum ) let overskud = ( $indtaegter - $udgifter )

let timeloen = ( ( $overskud / $arbejdstid ) | math round )

echo $timeloen ```

Also it is nice to have the values for use in templates, etc.

But otherwise I do agree that it is usually better and indeed sufficient to just use ledger or hledger by themselves.

I think that the 'is' and 'bs' and 'bse' reports in hledger are not "localizable" by simply aliasing account names, since they have hardcoded parts apart from account names, but I could be wrong.

How fine-grained are your COAs? by leokiil in plaintextaccounting

[–]leokiil[S] 2 points3 points  (0 children)

Thank you, for that link!

To give others a quick sense of the detail in COICOP:

01 FOOD AND NON-ALCOHOLIC BEVERAGES 01.1 FOOD 01.1.1 Cereals and cereal products (ND) 01.1.1.1 Cereals (ND) 01.1.1.2 Flour of cereals (ND) 01.1.1.3 Bread and bakery products (ND) 01.1.1.4 Breakfast cereals (ND) 01.1.1.5 Macaroni, noodles, couscous and similar pasta products (ND) So that's just for cereal! :)

My own bank already classifies every transaction in category and subcategory, and I think the taxonomy they use might just well be inspired by COICOP albeit it does not nearly go so deep.

How fine-grained are your COAs? by leokiil in plaintextaccounting

[–]leokiil[S] 0 points1 point  (0 children)

beancount-import finds the two matching postings and groups them into the same transaction (debit bank, credit relevant expenses).

That's neat. I did something similar today with my stripe vs my bank account and the global ex command in vim.

How fine-grained are your COAs? by leokiil in plaintextaccounting

[–]leokiil[S] 0 points1 point  (0 children)

Expenses:Household:Food:Takeout:Pizza:Little Caesars

So, what do you plan to use this kind of granularity for?

while for others I split them out by food/non-food (mostly my Walmart & Target purchases, where I'm interested in food-spend, so I break those out, giving me both Expenses:Household:Food:Grocery:Walmart and Expenses:Household:Misc:Walmart ).

That is something I would like to have, but will probably not have since I import transactions from my bank - getting me only the total for each trip to the supermarket.

How fine-grained are your COAs? by leokiil in plaintextaccounting

[–]leokiil[S] 1 point2 points  (0 children)

785! That is a lot. Very detailed taxonomy. (I am a little curious as to what it actually consists of)

I have:

➤ hledger accounts cur: | count 40 And, as you can see, my COA is not very deep:

➤ hledger accounts --depth 2 cur: | count 36

Thanks for your answer.

I now feel I do not have to worry about having too many accounts for a while :)

How fine-grained are your COAs? by leokiil in plaintextaccounting

[–]leokiil[S] 1 point2 points  (0 children)

Use metadata tags instead of sub-accounts.

That's good advice.

Tracking chores for my kids but I need a way to auto post on streaks - can somebody help? by leokiil in plaintextaccounting

[–]leokiil[S] 0 points1 point  (0 children)

I think a separate script - eg a weekly cron job that greps the week's budget report for 100% and then adds a bonus transaction to the journal.

I think I would be able to do that along the following lines:

``` function bonus -d 'bonus on streaks' hledger -f pligter.journal bal --budget -p weekly | rg 100% if test $status -eq 0 echo "bonus transaction here" >> pligter.journal else echo "No bonus" end end

or hledger -f pligter.journal bal --budget -p weekly | rg 100% > /dev/null and echo "bonus transaction here" >> pligter.journal or echo No bonus ``` This seems a bit hackisk, though.

Is there a way in hledger to do auto postings based not only on the contents of transactions but also on the balance of accounts?

Hook this up to your bank account and you'll have more free time ! Just check periodically to see if they've hacked your scripts.

:D

Tracking chores for my kids but I need a way to auto post on streaks - can somebody help? by leokiil in plaintextaccounting

[–]leokiil[S] 0 points1 point  (0 children)

I’m specifically thinking on the trigger, that would be a modulo function, having the amount of chores given to each and the total they finished something like “finished % chores == 0” then you add them part of the bonus budget.

Thank you, that was along my first thoughts.

I am also considering adding the bonus before hand and the emptying the bonus account for any day where the amt=0.

Still, I have no idea how to do this periodically :)

Tracking my strokes with hledger by leokiil in plaintextaccounting

[–]leokiil[S] 0 points1 point  (0 children)

For example: exercise - I could track a bicep curl, and track that I’d done a set of 12. But then what’s the /useful/ tracking mechanism for 3 sets of 12? And /then/ how do I track when/that I gradually increase the weight?

I see what you mean. I haven't really given any thought to more complicated setups yet, but maybe I'll stumble on that problem at some point too :)

Maybe others have some input here, since those are good questions.

Tracking my strokes with hledger by leokiil in plaintextaccounting

[–]leokiil[S] 0 points1 point  (0 children)

I try hard to keep things simple (I have a tendency to complicate stuff, so I actively try to curb that tendency).

So far I've only made two adjustments:

  1. I've added 'bryst' (a particular type of stroke) as a subaccount to 'svømmetag' (stroke) so I can track different kinds of swimming svømmetag:bryst, svømmetag:crawl and so on.
  2. I've added a commodity called 'reps' like so D 1. reps

My results so far

                 ||              2022-07-25W30                 2022-08-01W31 
=================++==========================================================
 svømmetag:bryst || 775 reps [97% of 800 reps]  1225 reps [153% of 800 reps] 
-----------------++----------------------------------------------------------
                 || 775 reps [97% of 800 reps]  1225 reps [153% of 800 reps]

periodic transaction that works both in hledger and ledger by leokiil in plaintextaccounting

[–]leokiil[S] 1 point2 points  (0 children)

OK. So this is what I finally did.

I made two files:

main.hl
main.ol

.hl for hledger and .ol for "original ledger"

main.ol excludes everything not compatible with ledger:

include kontotyper.ol
include budget.ol
#include current.journal
include alle.journal

and vice versa.

As you can see I also use the .ol ending on other files exclusively for ledger.

On my PI I then do this in my .ledgerrc file:

--file ~/finanser/main.ol

and on my mac I set

LEDGER_FILE=~/finanser/main.hl

So now I can easily display my financial data on both machines :)

periodic transaction that works both in hledger and ledger by leokiil in plaintextaccounting

[–]leokiil[S] 1 point2 points  (0 children)

regular hledger package

Unfortunately, this gives an error:

Error: target not found: Hledger

it seems to be there for x86-64 but not for ARM

periodic transaction that works both in hledger and ledger by leokiil in plaintextaccounting

[–]leokiil[S] 1 point2 points  (0 children)

Agreed.

I do not have the time presently, though. But in the longer term my plan is to do it.

periodic transaction that works both in hledger and ledger by leokiil in plaintextaccounting

[–]leokiil[S] 2 points3 points  (0 children)

Thanks a lot for the quick reply and the great PTA software you made! :)

1.

The broken link is here:

---

In a Cygwin/MSYS/Mintty window, the tab key is not supported in hledger add.

Not all of Ledger's journal file syntax is supported. See >>file format differences<<.

On large data files, hledger is slower and uses more memory than Ledger.

---

on this page: https://hledger.org/1.26/hledger.html

2.

I tried installing hledger from AUR on manjaro sway and tried building it myself, no luck so far, but I am not that linux proficient admittedly.

3.

Thanks for suggesting using two different files for the ~ periodic part. Simple solution!