reckon icon indicating copy to clipboard operation
reckon copied to clipboard

Ledger output should support comma separated values

Open BlackEdder opened this issue 11 years ago • 4 comments

Currently only ledger output in dot separated decimal values is supported. Ideally should also support comma separated decimals in output.

BlackEdder avatar Jun 11 '14 08:06 BlackEdder

Any news on this issue?

AlessandroW avatar Nov 01 '20 10:11 AlessandroW

Hi @AlessandroW this is a pretty old issue that hasn't gotten a lot of attention.

I have some ideas for implementing that I don't think would be too tough, but want to make sure that any proposed solution would meet your needs. Can you give me a little background on what you're trying to do or some examples of what the output would look like?

Thanks

benprew avatar Nov 02 '20 07:11 benprew

Hi! Sorry, for answering so late. Reckon actually solves this problem already by converting from comma separated cents to point separated cents. I only had to change the format once in my journal (from comma to point) and now everything works fine.

Here an example of my workflow: Assume the input is a csv file like the following (input.csv):

"Day";"Text";"Amount (EUR)";
"17.03.2021";"Sample Income";"12,50";
"18.03.2021";"Sample Expense";"-12,50";

Using Reckon this will lead to the following output (2021.journal)

2021-03-17	Sample Income	; 
	assets			 12.50 EUR
	revenues			

2021-03-18	Sample Expense	; 
	expenses			
	assets			-12.50 EUR


❯ reckon -f input.csv --currency "EUR" --suffixed \
… ❯ --comma-separates-cents \
… ❯ --csv-separator ";" \
… ❯ --contains-header 1 \
… ❯ -a assets -o 2021.journal
Using column 3 as the money column.  Use --money-colum to specify a different one.

    Date    |   Amount   |  Description  | Note |
 2021-03-17 |  12.50 EUR | Sample Income |      |
Which account provided this income? ([account]/[q]uit/[s]kip/[n]ote/[d]escription)
revenues

    Date    |   Amount   |  Description   | Note |
 2021-03-18 | -12.50 EUR | Sample Expense |      |
To which account did this money go? ([account]/[q]uit/[s]kip/[n]ote/[d]escription)  |revenues|
expenses

If you have another csv that uses a point as separator you simply omit the flag.

While you could add the feature "--comma-as-output" so that you can convert between "." and "," as you wish I am not sure if it is necessary.

Input Output Flags
. . None
. , –comma-as-output
, . –comma-separates-cents
, , –comma-as-output –comma-separates-cents

AlessandroW avatar Mar 18 '21 12:03 AlessandroW

@AlessandroW Thanks for getting back to me and I'm glad you've got it working. I think your explanation would be helpful to other people, I'll add it to the docs.

Thanks for writing this up.

benprew avatar Mar 29 '21 05:03 benprew