Bug 349976 - default categories for payees
Summary: default categories for payees
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: 1.12.5
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-06 21:07 UTC by Silver Salonen
Modified: 2015-11-25 12:39 UTC (History)
2 users (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 Silver Salonen 2015-07-06 21:07:09 UTC
It would be very useful to have some checkbox like "Use as default category for this payee" when changing category of an operation.

Reproducible: Always

Steps to Reproduce:
1. Insert/import new operation
2. If there's a default category stored for the payee, it will be used for the operation
3. When specifying a category manually, there's checkbox "Use as default category for this payee" which associates/updates payee with the specified category

Actual Results:  
Category is always empty by default and has to be manually specified.


Payee--category relations could be managed from both Categories and Payees pages.
Comment 1 Guillaume DE BURE 2015-07-07 10:38:45 UTC
Hmmm, I am a bit reluctant on this one. We have the fast edit providing a good alternative, do we really need to add another function (and bloat) to cover this ?
Comment 2 Silver Salonen 2015-07-07 10:40:30 UTC
Default categories function is not currently implemented at all, is it?
Comment 3 Guillaume DE BURE 2015-07-07 15:18:49 UTC
Nope, but we have something which is (IMHO) even more efficient, called "fast edition" :

https://docs.kde.org/trunk5/en/extragear-office/skrooge/operations.html#fast_edition

Have a look on this, and get back to us if you find it useful. I think it covers your need, plus other cases.
Comment 4 Silver Salonen 2015-07-07 17:27:18 UTC
Fast editing looks useful indeed. However, in my case it would not take effect so much as I'm relying mostly on CSV imports to insert data.
Comment 5 Guillaume DE BURE 2015-07-07 21:03:25 UTC
Ah sorry, overlooked that you mentionned importing operations. In that case, you should use the "search and process" capabilities, as this is exactly what we designed it for :)

1. Define a rule setting the category for each payee for imported operations (https://docs.kde.org/trunk5/en/extragear-office/skrooge/search_and_process.html)
2. Configure skrooge to apply rules after import : "settings > configure skrooge > Import / Export > Apply rules on imported operations"

Have a look in the real case study in the documentation, it might give you clearer directions :
https://docs.kde.org/trunk5/en/extragear-office/skrooge/search_process_real_case.html

I know that at first sight it might seem a bit overkill, but once you master it, you never want to go back again, I promise :) :) :)
Comment 6 Silver Salonen 2015-07-07 21:06:05 UTC
Yes, this looks a bit overkill for such a simple operation. And managing these rules is not so easy either - I'd happily make a script to start creating these rules by big heaps of payees I have, but this is not possible. Also, what about a bit simpler users that cannot understand scripting or creating these powerful rules? :)
Comment 7 Stephane MANKOWSKI 2015-08-19 19:08:30 UTC
Hi, 

I am still thinking to this request.
I would like to try to propose the better category automatically.

Could you do this from the console to help me?
1- export SKGTRACEPERFO=1
2-skrooge
3-Open the page "Debug"
4-Execute the following sql order:
SELECT S1.t_PAYEE, S1.t_REALCATEGORY, 100*S1.NB/S2.NBTOTAL AS POURCENT FROM (SELECT t_PAYEE, t_REALCATEGORY, count(1) AS NB FROM v_suboperation_consolidated GROUP BY t_PAYEE, t_REALCATEGORY) S1, (SELECT t_PAYEE, count(1) AS NBTOTAL FROM v_suboperation_consolidated GROUP BY t_PAYEE) S2 WHERE S1.t_PAYEE=S2.t_PAYEE AND POURCENT>90

Could you confirm the category is what you would like to see when the payee is entered?
Comment 8 Stephane MANKOWSKI 2015-09-22 13:48:48 UTC
Do you have an answer to my previous request?
Comment 9 Silver Salonen 2015-09-22 18:48:09 UTC
Sorry about the delay.

Yes, I'd like that category to be set automatically for payees.
Comment 10 Stephane MANKOWSKI 2015-09-30 20:35:56 UTC
Git commit 2c54e79b95dad6693d963160619a25cb80844e83 by Stephane Mankowski.
Committed on 30/09/2015 at 20:35.
Pushed by smankowski into branch 'master'.

Default categories for payees

M  +1    -0    CHANGELOG
M  +7    -0    plugins/import/skrooge_import_csv/skgimportplugincsv.cpp
M  +4    -0    plugins/skrooge/skrooge_operation/skgoperation_settings.kcfg
M  +8    -0    plugins/skrooge/skrooge_operation/skgoperationpluginwidget.cpp
M  +1    -0    plugins/skrooge/skrooge_operation/skgoperationpluginwidget.h
M  +13   -5    plugins/skrooge/skrooge_operation/skgoperationpluginwidget_pref.ui
M  +27   -0    skgbankmodeler/skgdocumentbank.cpp
M  +7    -0    skgbankmodeler/skgdocumentbank.h
M  +2    -0    tests/skgbankmodelertest/skgtestimportcsv.cpp

http://commits.kde.org/skrooge/2c54e79b95dad6693d963160619a25cb80844e83
Comment 11 Stephane MANKOWSKI 2015-11-25 12:39:50 UTC
Git commit fcd0c52fc03461f0725349ad790859a72c6ec320 by Stephane Mankowski.
Committed on 25/11/2015 at 12:39.
Pushed by smankowski into branch 'master'.

default categories for payees

M  +2    -2    skgbankmodeler/skgdocumentbank.cpp

http://commits.kde.org/skrooge/fcd0c52fc03461f0725349ad790859a72c6ec320