Bug 333875 - ledger: no associated category sets the type of the entry to transfer
Summary: ledger: no associated category sets the type of the entry to transfer
Status: RESOLVED INTENTIONAL
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.6.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-25 14:22 UTC by Yasin Zähringer
Modified: 2014-04-27 10:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Details of a transaction without a category. The wrong tab is displayed. (19.01 KB, image/jpeg)
2014-04-27 00:59 UTC, Yasin Zähringer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yasin Zähringer 2014-04-25 14:22:14 UTC
When manually adding entries (page 'ledgers'), the entry type is displayed incorrectly when there is no associated category.

Reproducible: Always

Steps to Reproduce:
1. go to 'ledgers'
2. add an entry without a category of type 'withdrawal'
3. save it
Actual Results:  
The entry is shown as type 'transfer'. When editing it jumps back to the correct type.
Comment 1 Thomas Baumgart 2014-04-25 15:44:19 UTC
Fixed in git master: one cannot complete step 2 of your procedure as entering a transaction without an assigned category.
Comment 2 Yasin Zähringer 2014-04-25 17:40:39 UTC
The problem also happens when you import data from a file as not always a category can be found. Was this also fixed?
Comment 3 allan 2014-04-25 21:15:59 UTC
On 25/04/14 18:40, Yasin Zähringer  wrote:
> https://bugs.kde.org/show_bug.cgi?id=333875
>
> Yasin Zähringer <yasinzaehringer+kde@yhjz.de> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|RESOLVED                    |UNCONFIRMED
>           Resolution|FIXED                       |---
>
> --- Comment #2 from Yasin Zähringer <yasinzaehringer+kde@yhjz.de> ---
> The problem also happens when you import data from a file as not always a
> category can be found. Was this also fixed?
>

What happens on import depends largely on the input file.  For instance, 
with a QIF file, it would then depend on the source of the file.  If it 
was produced by another personal finance program of yours, then it is 
possible that the file could include a transfer to another known local 
account.  A file from say a bank will not have any notion of the local 
account structure, and likely will contain only deposits or withdrawals.

OFX and CSV files generally are not produced by personal finance 
programs, so they too would contain only deposits or withdrawals.  The 
CSV import plugin can now handle categories, but up to now there has not 
been a requirement for transfers.

In the main, then, with imports other than QIF, the transactions are 
likely to be flagged as missing an assignment.

Allan
Comment 4 Yasin Zähringer 2014-04-26 11:44:03 UTC
Thanks for the detailed explanation! Am I correct when I claim that the underlying bug isn't fixed? Only my procedure to reproduce it has to be adapted? If you want, I can write down the test case.
Comment 5 allan 2014-04-26 12:18:17 UTC
On 26/04/14 12:44, Yasin Zähringer  wrote:
> https://bugs.kde.org/show_bug.cgi?id=333875
>
> --- Comment #4 from Yasin Zähringer <yasinzaehringer+kde@yhjz.de> ---
> Thanks for the detailed explanation! Am I correct when I claim that the
> underlying bug isn't fixed? Only my procedure to reproduce it has to be
> adapted? If you want, I can write down the test case.
>

As Thomas said,
--- Comment #1 from Thomas Baumgart <ipwizard@users.sourceforge.net> ---
Fixed in git master: one cannot complete step 2 of your procedure as 
entering a
transaction without an assigned category.

If you are still able to reproduce the problem, but now using the latest 
version, then, yes, please do show your test case.  As I see it, too, 
one cannot save a new transaction without a category.

Allan
Comment 6 Yasin Zähringer 2014-04-26 12:57:36 UTC
I think the bug is triggered by transactions without an associated category. As there is no direct way anymore to enter a transaction without a category, I suggest you try the following:

1. Import a transaction from a CSV file, for example the spaces.csv mentioned in https://bugs.kde.org/show_bug.cgi?id=333911 (importing instructions are given in the bug description)
2. Go to ledgers and view the transaction.

If it doesn't show the transaction type as 'Transfer', then the bug is indeed fixed.
Comment 7 Yasin Zähringer 2014-04-27 00:57:38 UTC
I just checked the issue with the current git master and it still exists. Import the referenced csv file and select the transaction, then the displayed transaction type is 'Transfer'. When you edit the transaction, the tab switches to the correct type. I attach a screenshot.
Comment 8 Yasin Zähringer 2014-04-27 00:59:40 UTC
Created attachment 86287 [details]
Details of a transaction without a category. The wrong tab is displayed.
Comment 9 Thomas Baumgart 2014-04-27 03:34:29 UTC
That is not as easy as it might look in the first place as KMyMoney tries to hide the sign in the amount field: In order to determine a deposit or a withdrawal one thus needs to know, which account type the other side of the transaction references to. In this case here, this essential piece of information is missing. One could certainly argue, that the information could be extracted from what is present and update the display accordingly. One could also argue, in case the program does not know it, it treats it as transfer. We have decided to go the latter route.

Since this part of the code has to deal with a bunch of corner-cases, I really don't want to touch it right now as it is otherwise not broken but works as designed. The design might not be in line with your view.

Example: what should be done, in case the amount is zero? No way to determine if it's a deposit or withdrawal anymore. And yes, I receive such transactions while downloading from my bank. Plus, these are the only transactions that are allowed to have a single split to balance.

I would suggest to mark this one as a wishlist item and set the topic to something like "Unassigned transactions should be displayed as deposit/withdrawal not transfers". BTW, patches are very welcome.
Comment 10 Yasin Zähringer 2014-04-27 09:41:25 UTC
Thanks for the nice explanation! I start to see your point and now I am not sure if I can justify my opinion any longer. Probably we should leave it as is for the moment and see what the future brings.
Comment 11 allan 2014-04-27 10:15:08 UTC
I've now marked this as CLOSED-WONTFIX.
If this should be changed, feel free.