Bug 340317 - Support category assignment with partial account name
Summary: Support category assignment with partial account name
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: 4.7.0
Platform: Other Other
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-24 20:00 UTC by Ralf Habacker
Modified: 2014-10-31 12:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2014-10-24 20:00:00 UTC
The cvs importer has an option to import transactions into a dedicated category/account using a category column. The recent implementation requires to provide the full category name for example: 

date;nr;amount;category;
1.1.2014;1;123.5;"2121 Zinsaufwendungen für KFZ Finanzierung"

It would be nice to be able to search for a substring in the category name for example the account number as shown below. 

date;nr;amount;category;
1.1.2014;1;123.5;"2121"


Reproducible: Always
Comment 1 allan 2014-10-24 21:30:43 UTC
Just to clarify my thinking, the CSV importer just requires the column number for the category.  That field is then imported into KMM, as is.  The importer is unaware of actual category names and IDs.

It sounds like you are asking for a search capability in the importer, in order to select and import a recognised category, rather than for KMM to handle that.  Have I got that right?

My understanding is that the importer should not have access to KMM's internal workings, except where it provides an interface,  That could be incorrect, so I would appreciate guidance on this from the KMM devs.
Comment 2 allan 2014-10-31 00:43:08 UTC
Not received any feedback, as yet, but working on the CSV exporter has reminded me that that has an account selector, and also can export categories, so it may be that there already is some access that could be made use of.  The exporter account selector has only a limited search capability, producing the first account found with the initial letter entered, rather than a 'containing' string search, but that probably may be modified.
Were you thinking of both accounts and categories?
Comment 3 Ralf Habacker 2014-10-31 08:21:20 UTC
(In reply to allan from comment #1)
> Just to clarify my thinking, the CSV importer just requires the column
> number for the category.  That field is then imported into KMM, as is.
>  The importer is unaware of actual category names and IDs.> 

You say that if I would use the following csv line 
1.1.2014;1;-3333.5;"Zinsaufwendungen:2121 Zinsaufwendungen für KFZ Finanzierung" ;
the related entry will be directly imported into the 
category  "Expense:Zinsaufwendungen:2121 Zinsaufwendungen für KFZ Finanzierung"

but if I use a non present category  like 
1.1.2014;1;-3333.5;"2121 Zinsaufwendungen für KFZ Finanzierung" ;
there will be a new category  "Expense:2121 Zinsaufwendungen für KFZ Finanzierung" created.

> It sounds like you are asking for a search capability in the importer, in
> order to select and import a recognised category, rather than for KMM to
> handle that.  Have I got that right?

I would like to specifiy 
1.1.2014;1;-3333.5;"2121" ;

and kmm should assign this transaction to the present kmm category  containing the term "2121", which is in the related case  "Expense:Zinsaufwendungen:2121 Zinsaufwendungen für KFZ Finanzierung"
Comment 4 Ralf Habacker 2014-10-31 09:33:20 UTC
(In reply to Ralf Habacker from comment #3)
> (In reply to allan from comment #1)
> > Just to clarify my thinking, the CSV importer just requires the column
> > number for the category.  That field is then imported into KMM, as is.
> >  The importer is unaware of actual category names and IDs.> 
> 
> You say that if I would use the following csv line 
> 1.1.2014;1;-3333.5;"Zinsaufwendungen:2121 Zinsaufwendungen für KFZ
> Finanzierung" ;
> the related entry will be directly imported into the 
> category  "Expense:Zinsaufwendungen:2121 Zinsaufwendungen für KFZ
> Finanzierung"
> 
> but if I use a non present category  like 
> 1.1.2014;1;-3333.5;"2121 Zinsaufwendungen für KFZ Finanzierung" ;
> there will be a new category  "Expense:2121 Zinsaufwendungen für KFZ
> Finanzierung" created.
> 
> >  The importer is unaware of actual category names and IDs.> 
at least it takes the sign of the transaction amount to choose the top level category

Importing this csv content

date;nr;amount;category; 
1.1.2014;1;3333.1;"2121 Zinsaufwendungen für KFZ Finanzierung" ;
3.1.2014;1;1224.1;"8400 Erlöse USt. 19%" ;
3.1.2014;1;-1224.1;"8401 Erlöse USt. 19%" ;

results into assignments to 

"Expense:2121 Zinsaufwendungen für KFZ Finanzierung"
"Income:8400 Erlöse USt. 19%"
"Expense:8400 Erlöse USt. 19%"
Comment 5 Ralf Habacker 2014-10-31 09:39:09 UTC
(In reply to allan from comment #2)
> Not received any feedback, as yet, but working on the CSV exporter has
> reminded me that that has an account selector, and also can export
> categories, so it may be that there already is some access that could be
> made use of.  The exporter account selector has only a limited search
> capability, producing the first account found with the initial letter
> entered, rather than a 'containing' string search, but that probably may be
> modified.
> Were you thinking of both accounts and categories?
yes, 
cvs import requires to specify an account where to import to, so categories are the targets, but if you are booking for example a pre year VAT you need to specify a liability account (e.g. 1790 Umsatzsteuer Vorjahr), so it is required to support both.
Comment 6 allan 2014-10-31 12:03:25 UTC
(In reply to Ralf Habacker from comment #3)
> (In reply to allan from comment #1)
> > Just to clarify my thinking, the CSV importer just requires the column
> > number for the category.  That field is then imported into KMM, as is.
> >  The importer is unaware of actual category names and IDs.> 
> 
> You say that if I would use the following csv line 
> 1.1.2014;1;-3333.5;"Zinsaufwendungen:2121 Zinsaufwendungen für KFZ
> Finanzierung" ;
> the related entry will be directly imported into the 
> category  "Expense:Zinsaufwendungen:2121 Zinsaufwendungen für KFZ
> Finanzierung"
> 
> but if I use a non present category  like 
> 1.1.2014;1;-3333.5;"2121 Zinsaufwendungen für KFZ Finanzierung" ;
> there will be a new category  "Expense:2121 Zinsaufwendungen für KFZ
> Finanzierung" created.
> 
> > It sounds like you are asking for a search capability in the importer, in
> > order to select and import a recognised category, rather than for KMM to
> > handle that.  Have I got that right?
> 
> I would like to specifiy 
> 1.1.2014;1;-3333.5;"2121" ;
> 
> and kmm should assign this transaction to the present kmm category 
> containing the term "2121", which is in the related case 
> "Expense:Zinsaufwendungen:2121 Zinsaufwendungen für KFZ Finanzierung"

This sounds like what you need is a capability for categories which is similar to that for payees, where you can specify alternative category names which will be matched to a base category.  Is that it?
Comment 7 allan 2014-10-31 12:12:03 UTC
> > >  The importer is unaware of actual category names and IDs.>

> at least it takes the sign of the transaction amount to choose the top level
> category

What it is actually doing is using the sign to decide if this is an income or an expense, and then processing it accordingly.

> Importing this csv content
> 
> date;nr;amount;category; 
> 1.1.2014;1;3333.1;"2121 Zinsaufwendungen für KFZ Finanzierung" ;
> 3.1.2014;1;1224.1;"8400 Erlöse USt. 19%" ;
> 3.1.2014;1;-1224.1;"8401 Erlöse USt. 19%" ;
> 
> results into assignments to 
> 
> "Expense:2121 Zinsaufwendungen für KFZ Finanzierung"
> "Income:8400 Erlöse USt. 19%"
> "Expense:8400 Erlöse USt. 19%"