Bug 388955 - Splitting Currency and Amount into separate columns
Summary: Splitting Currency and Amount into separate columns
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: 2.10.0
Platform: unspecified All
: NOR wishlist
Target Milestone: ---
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-14 12:27 UTC by dterrahe
Modified: 2018-01-17 17:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
currency export test database (379.02 KB, application/octet-stream)
2018-01-14 15:54 UTC, dterrahe
Details
Result of copy paste (2.32 KB, text/csv)
2018-01-15 22:47 UTC, Stephane MANKOWSKI
Details
Copy / paste with only needed raw and unit (1.99 KB, text/csv)
2018-01-17 14:05 UTC, Stephane MANKOWSKI
Details
Copy / paste with only needed raw and unit and better management of boolean (2.13 KB, text/csv)
2018-01-17 17:35 UTC, Stephane MANKOWSKI
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dterrahe 2018-01-14 12:27:25 UTC
Throughout skrooge all amounts have their currency symbol attached. This can be inconvenient when exporting/copying the data into a spreadsheet to do further calculations because then the currency needs to be stripped off first (using Text to columns). Having a switch for each table in the Columns/View Appearance menu to split off the currency symbol would be useful. I think only one currency column would be needed, not one for each amount column, because only the operation/account specific currency and the account/base currently are ever used in each line, so one can infer from the column type which one it is (if one decides to choose this view).
Comment 1 Stephane MANKOWSKI 2018-01-14 12:54:14 UTC
Hi,

What is your detailed scenario?
I tried this one:
1- Open Skrooge
2- Open the operations page
3- Select some operations
4- Right click + "Copy"
5- Open LibreOffice 5.1.6.2
6- Paste

Result:
Amounts are well received by LibreOffice with units but are well parsed and only the value is set in the cells (without the unit).
Comment 2 dterrahe 2018-01-14 15:54:22 UTC
Created attachment 109860 [details]
currency export test database
Comment 3 dterrahe 2018-01-14 16:05:20 UTC
Hi Stephane,

I use three letter currency codes, rather than symbols, because that's how most of my banks set it in their ofx files and otherwise I always end up with a duplicate unit and need to fix it afterwards.

I have attached a test skrooge document with 6 accounts, 2 for each currency GBP (my base currency), USD and EUR, each with a 3 letter code and with a symbol. If I show all transactions with Category "Interest" and then copy paste to LibreOffice (5.4.4) only the £ version gets converted to a number (it is my system currency, which Libreoffice picks up); the others are strings with code and number combined.
(copy pasting into this forum messes up formatting, but I have right aligned the numbers manually below whereas the strings are left aligned).

Account	Amount	Amount entered
USD2	 £72.82	USD100.00
USD1	 £72.82	$100.00
GBP2	£100.00	GBP100.00
GBP1	£100.00	        £100.00
EUR2	 £88.81	EUR100.00
EUR1	 £88.81	€100.00

Even if I could get libreoffice to "ignore" the currency code, I still need it to determine the exchange rate (unless I can fetch the correct one from Skrooge; I asked a question on the forum because I don't know if this is possible maybe using monthly reports).

This is very much wishlist; I may be the only one to benefit if you "fix" this for me, so I won't be offended if you ignore it and I'll continue to use my workaround. :-)
Comment 4 Stephane MANKOWSKI 2018-01-15 22:47:50 UTC
Created attachment 109895 [details]
Result of copy paste

Hi,

I did a small correction to copy/paste the displayed values AND the raw values.
As you can see, this could be interesting for dates and values.

Do you think this could help you?
Regards.
Comment 5 dterrahe 2018-01-16 06:42:38 UTC
Yes, the raw columns would be useful for me, with a separate column for the currency code.

Somehow there seem to be extra characters in the non-raw columns with currency values that do not show up under linux LibreOffice, but that turn into strange symbols (�贈) under windows.
Comment 6 Stephane MANKOWSKI 2018-01-17 14:05:03 UTC
Created attachment 109935 [details]
Copy / paste with only needed raw and unit

Hi,
I did a correction with:
1-to keep only needed raw columns (when at least one raw value is different than the displayed value) 
2- Better header title
3- New unit column for "operation"

Is this result the expected one?
Comment 7 dterrahe 2018-01-17 16:44:35 UTC
That looks good! (although under Windows, I'm looking at it at work, Excel sees some strange characters in the currency symbols; maybe it doesn't recognize that it is UTF-8? Either way; it won't be a problem for me because I don't use symbols but 3 letter codes)

There are a few columns (booleans) that get duplicated because N gets formatted as "". The separate raw column might not be useful, so you could filter those out.
Comment 8 Stephane MANKOWSKI 2018-01-17 17:35:26 UTC
Created attachment 109944 [details]
Copy / paste with only needed raw and unit and better management of boolean

Hi,

Here is a new version taking into account your remark about boolean attributes.
I don't know what to do with the "strange characters" because in fact this is an unbreakable space between the amount and its unit. I prefer to keep it like this event if windows doesn't manage it well.

Do you agree to close this incident like this?
Regards.
Comment 9 dterrahe 2018-01-17 17:38:14 UTC
Sure, sure, absolutely. I'm happy with this. Thank you!
Comment 10 Stephane MANKOWSKI 2018-01-17 17:41:13 UTC
Git commit 62409a23b6937e38fc3f4bf258ba131d05a760c1 by Stephane Mankowski.
Committed on 17/01/2018 at 17:40.
Pushed by smankowski into branch 'master'.

Splitting Currency and Amount into separate columns

M  +1    -0    CHANGELOG
M  +17   -4    skgbankgui/skgobjectmodel.cpp
M  +5    -5    skgbankmodeler/skgdocumentbank.cpp
M  +85   -21   skgbasegui/skgtreeview.cpp
M  +1    -0    skgbasegui/skgtreeview.h

https://commits.kde.org/skrooge/62409a23b6937e38fc3f4bf258ba131d05a760c1