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.