Add statistics

Update README
Update TODO
This commit is contained in:
Grégory Soutadé 2010-08-18 21:28:40 +02:00
parent 74c401c8c7
commit 5da154cd48
9 changed files with 251 additions and 124 deletions

2
README
View File

@ -2,7 +2,7 @@ KissCount is personnal account software delivered under GPL v3 licence terms.
Current version is 0.1 beta (trunk version) Current version is 0.1 beta (trunk version)
wxWidgets 2.8 is needed wxWidgets 2.8 and sqlite3 is needed
A modified version of wxFreeChart is used : warning during recompilation, don't overwrite autotools files with ./configure A modified version of wxFreeChart is used : warning during recompilation, don't overwrite autotools files with ./configure

View File

@ -2,7 +2,7 @@ KissCount est un logiciel de gestion de comptes personnels délivré sous licenc
La version actuelle est 0.1 bêta (version du tronc) La version actuelle est 0.1 bêta (version du tronc)
wxWidgets 2.8 est nécessaire wxWidgets 2.8 et sqlite3 sont nécessaire
Une version modifiée de wxFreeChart est utilisée : attention à lors de la recompilation à ne pas écraser les fichiers des autotools (pas de ./configure) Une version modifiée de wxFreeChart est utilisée : attention à lors de la recompilation à ne pas écraser les fichiers des autotools (pas de ./configure)

2
TODO
View File

@ -1,6 +1,6 @@
Version 0.1 Version 0.1
Statistics Statistics (need to update libraries and add months/years label on graph)
Copy and paste Copy and paste
Import/Export module Import/Export module
Using tabulation to navigate throw interface (Search Panel) Using tabulation to navigate throw interface (Search Panel)

Binary file not shown.

View File

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-08-14 22:00+0200\n" "POT-Creation-Date: 2010-08-18 20:59+0200\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: Soutadé <soutade@gmail.com>\n" "Last-Translator: Soutadé <soutade@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -19,6 +19,7 @@ msgstr ""
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#: src/view/PreferencesPanel.cpp:574 #: src/view/PreferencesPanel.cpp:574
#: src/view/StatsPanel.cpp:288
msgid " - " msgid " - "
msgstr " - " msgstr " - "
@ -39,7 +40,7 @@ msgstr " entrées trouvées"
msgid " not found, aborting" msgid " not found, aborting"
msgstr " non trouvé, arrêt" msgstr " non trouvé, arrêt"
#: src/view/AccountPanel.cpp:936 #: src/view/AccountPanel.cpp:924
msgid " operations ?" msgid " operations ?"
msgstr " opérations ?" msgstr " opérations ?"
@ -51,7 +52,7 @@ msgstr " profil ?"
msgid "1 entry found" msgid "1 entry found"
msgstr "1 entrée trouvée" msgstr "1 entrée trouvée"
#: src/view/ButtonPanel.cpp:51 #: src/view/ButtonPanel.cpp:52
msgid "About" msgid "About"
msgstr "A propos" msgstr "A propos"
@ -65,15 +66,16 @@ msgstr "Compte"
msgid "Account " msgid "Account "
msgstr "Le compte " msgstr "Le compte "
#: src/view/AccountPanel.cpp:113 #: src/view/AccountPanel.cpp:101
msgid "Account name" msgid "Account name"
msgstr "Nom du compte" msgstr "Nom du compte"
#: src/view/AccountPanel.cpp:112 #: src/view/AccountPanel.cpp:100
msgid "Account number" msgid "Account number"
msgstr "Numéro de compte" msgstr "Numéro de compte"
#: src/view/PreferencesPanel.cpp:55 #: src/view/PreferencesPanel.cpp:55
#: src/view/StatsPanel.cpp:256
msgid "Accounts" msgid "Accounts"
msgstr "Comptes" msgstr "Comptes"
@ -87,12 +89,12 @@ msgstr "Montant max"
#: src/view/PreferencesPanel.cpp:340 #: src/view/PreferencesPanel.cpp:340
#: src/view/PreferencesPanel.cpp:581 #: src/view/PreferencesPanel.cpp:581
#: src/view/AccountPanel.cpp:931 #: src/view/AccountPanel.cpp:919
msgid "Are you sure want to delete " msgid "Are you sure want to delete "
msgstr "Etes vous sûr de vouloir supprimer " msgstr "Etes vous sûr de vouloir supprimer "
#: src/view/PreferencesPanel.cpp:449 #: src/view/PreferencesPanel.cpp:449
#: src/view/AccountPanel.cpp:633 #: src/view/AccountPanel.cpp:621
#: src/view/SearchPanel.cpp:345 #: src/view/SearchPanel.cpp:345
msgid "Are you sure want to delete : \n" msgid "Are you sure want to delete : \n"
msgstr "Etes vous sûr de vouloir supprimer : \n" msgstr "Etes vous sûr de vouloir supprimer : \n"
@ -133,7 +135,7 @@ msgstr "Changer le mot de passe"
msgid "Change password" msgid "Change password"
msgstr "Changer le mot de passe" msgstr "Changer le mot de passe"
#: src/view/ButtonPanel.cpp:50 #: src/view/ButtonPanel.cpp:51
msgid "Change user" msgid "Change user"
msgstr "Changer d'utilisateur" msgstr "Changer d'utilisateur"
@ -145,7 +147,8 @@ msgstr "Couleur"
msgid "Confirm password " msgid "Confirm password "
msgstr "Confirmer le mot de passe" msgstr "Confirmer le mot de passe"
#: src/view/AccountPanel.cpp:123 #: src/view/StatsPanel.cpp:130
#: src/view/AccountPanel.cpp:111
msgid "Cost repartition" msgid "Cost repartition"
msgstr "Répartition des coûts" msgstr "Répartition des coûts"
@ -153,15 +156,15 @@ msgstr "Répartition des coûts"
msgid "Credit" msgid "Credit"
msgstr "Crédit" msgstr "Crédit"
#: src/view/AccountPanel.cpp:193 #: src/view/AccountPanel.cpp:181
msgid "Cur Credit" msgid "Cur Credit"
msgstr "Cur Crédit" msgstr "Cur Crédit"
#: src/view/AccountPanel.cpp:194 #: src/view/AccountPanel.cpp:182
msgid "Cur Debit" msgid "Cur Debit"
msgstr "Cur Débit" msgstr "Cur Débit"
#: src/view/AccountPanel.cpp:115 #: src/view/AccountPanel.cpp:103
msgid "Current value" msgid "Current value"
msgstr "Valeur courante" msgstr "Valeur courante"
@ -187,7 +190,7 @@ msgstr "Défaut"
#: src/view/PreferencesPanel.cpp:159 #: src/view/PreferencesPanel.cpp:159
#: src/view/PreferencesPanel.cpp:209 #: src/view/PreferencesPanel.cpp:209
#: src/view/AccountPanel.cpp:790 #: src/view/AccountPanel.cpp:778
msgid "Delete" msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
@ -211,7 +214,7 @@ msgstr "Description"
#: src/view/PreferencesPanel.cpp:487 #: src/view/PreferencesPanel.cpp:487
#: src/view/PreferencesPanel.cpp:526 #: src/view/PreferencesPanel.cpp:526
#: src/view/PreferencesPanel.cpp:532 #: src/view/PreferencesPanel.cpp:532
#: src/view/AccountPanel.cpp:927 #: src/view/AccountPanel.cpp:915
#: src/view/UsersDialog.cpp:86 #: src/view/UsersDialog.cpp:86
#: src/view/UsersDialog.cpp:114 #: src/view/UsersDialog.cpp:114
#: src/view/SearchPanel.cpp:134 #: src/view/SearchPanel.cpp:134
@ -225,7 +228,7 @@ msgstr "Erreur"
msgid "Error creating original database" msgid "Error creating original database"
msgstr "Erreur durant la création de la base de données initiale" msgstr "Erreur durant la création de la base de données initiale"
#: src/view/AccountPanel.cpp:116 #: src/view/AccountPanel.cpp:104
msgid "Final value" msgid "Final value"
msgstr "Valeur finale" msgstr "Valeur finale"
@ -239,12 +242,16 @@ msgstr "Fixe"
msgid "Font" msgid "Font"
msgstr "Police" msgstr "Police"
#: src/view/StatsPanel.cpp:62
msgid "From"
msgstr "De"
#: src/view/GenerateDialog.cpp:45 #: src/view/GenerateDialog.cpp:45
msgid "From " msgid "From "
msgstr "De" msgstr "De"
#: src/view/GenerateDialog.cpp:31 #: src/view/GenerateDialog.cpp:31
#: src/view/AccountPanel.cpp:787 #: src/view/AccountPanel.cpp:775
msgid "Generate month" msgid "Generate month"
msgstr "Générer mois" msgstr "Générer mois"
@ -256,7 +263,7 @@ msgstr "Courses"
msgid "Hobbies" msgid "Hobbies"
msgstr "Loisirs" msgstr "Loisirs"
#: src/view/AccountPanel.cpp:114 #: src/view/AccountPanel.cpp:102
msgid "Initial value" msgid "Initial value"
msgstr "Valeur initiale" msgstr "Valeur initiale"
@ -274,7 +281,7 @@ msgstr "Montant max invalide"
#: src/view/SearchPanel.cpp:134 #: src/view/SearchPanel.cpp:134
msgid "Invalid date range" msgid "Invalid date range"
msgstr "Intervalle des dates invalide" msgstr "Intervalle de temps invalide"
#: src/view/PreferencesPanel.cpp:526 #: src/view/PreferencesPanel.cpp:526
msgid "Invalid name" msgid "Invalid name"
@ -288,11 +295,15 @@ msgstr "Ancien mot de passe invalide"
msgid "Invalid password" msgid "Invalid password"
msgstr "Mot de passe invalide" msgstr "Mot de passe invalide"
#: src/view/StatsPanel.cpp:303
msgid "Invalide date range"
msgstr "Intervalle de temps invalide"
#: src/view/PreferencesPanel.cpp:336 #: src/view/PreferencesPanel.cpp:336
msgid "It must be at least one account !" msgid "It must be at least one account !"
msgstr "Il doit y avoir au moins un compte !" msgstr "Il doit y avoir au moins un compte !"
#: src/view/AccountPanel.cpp:927 #: src/view/AccountPanel.cpp:915
msgid "It must be at least one month !" msgid "It must be at least one month !"
msgstr "Il doit rester au mois un mois" msgstr "Il doit rester au mois un mois"
@ -302,6 +313,7 @@ msgstr "Kill me"
#: src/view/PreferencesPanel.cpp:566 #: src/view/PreferencesPanel.cpp:566
#: src/view/PreferencesPanel.cpp:569 #: src/view/PreferencesPanel.cpp:569
#: src/view/StatsPanel.cpp:303
msgid "KissCount" msgid "KissCount"
msgstr "KissCount" msgstr "KissCount"
@ -366,7 +378,7 @@ msgstr "Frais de fonctionnement"
msgid "Operation order" msgid "Operation order"
msgstr "Ordre des opérations" msgstr "Ordre des opérations"
#: src/view/ButtonPanel.cpp:46 #: src/view/ButtonPanel.cpp:47
msgid "Operations" msgid "Operations"
msgstr "Opérations" msgstr "Opérations"
@ -382,7 +394,7 @@ msgstr "Mot de passe"
msgid "Password changed" msgid "Password changed"
msgstr "Mot de passe changé" msgstr "Mot de passe changé"
#: src/view/ButtonPanel.cpp:96 #: src/view/ButtonPanel.cpp:102
msgid "" msgid ""
"Personal accounting software\n" "Personal accounting software\n"
"\n" "\n"
@ -398,29 +410,30 @@ msgstr "Re entrez le mot de passe"
#: src/view/PreferencesPanel.cpp:540 #: src/view/PreferencesPanel.cpp:540
#: src/view/PreferencesPanel.cpp:574 #: src/view/PreferencesPanel.cpp:574
#: src/view/ButtonPanel.cpp:49 #: src/view/ButtonPanel.cpp:50
msgid "Preferences" msgid "Preferences"
msgstr "Préférences" msgstr "Préférences"
#: src/view/ButtonPanel.cpp:52 #: src/view/ButtonPanel.cpp:53
msgid "Quit" msgid "Quit"
msgstr "Quitter" msgstr "Quitter"
#: src/view/ButtonPanel.cpp:103 #: src/view/ButtonPanel.cpp:109
msgid "Quit KissCount ?" msgid "Quit KissCount ?"
msgstr "Quitter KissCount ?" msgstr "Quitter KissCount ?"
#: src/view/AccountPanel.cpp:195 #: src/view/AccountPanel.cpp:183
msgid "Remains" msgid "Remains"
msgstr "Restant" msgstr "Restant"
#: src/view/SearchPanel.cpp:78 #: src/view/SearchPanel.cpp:78
#: src/view/SearchPanel.cpp:239 #: src/view/SearchPanel.cpp:239
#: src/view/ButtonPanel.cpp:48 #: src/view/ButtonPanel.cpp:49
msgid "Search" msgid "Search"
msgstr "Chercher" msgstr "Chercher"
#: src/view/AccountPanel.cpp:97 #: src/view/StatsPanel.cpp:122
#: src/view/AccountPanel.cpp:85
msgid "Serie 1" msgid "Serie 1"
msgstr "Série 1" msgstr "Série 1"
@ -428,19 +441,24 @@ msgstr "Série 1"
msgid "Shared" msgid "Shared"
msgstr "Partagé" msgstr "Partagé"
#: src/view/ButtonPanel.cpp:47 #: src/view/StatsPanel.cpp:288
#: src/view/ButtonPanel.cpp:48
msgid "Statistics" msgid "Statistics"
msgstr "Statistiques" msgstr "Statistiques"
#: src/view/StatsPanel.cpp:69
msgid "To"
msgstr "A"
#: src/view/GenerateDialog.cpp:52 #: src/view/GenerateDialog.cpp:52
msgid "To " msgid "To "
msgstr "A" msgstr "A"
#: src/view/AccountPanel.cpp:177 #: src/view/AccountPanel.cpp:165
msgid "Total Credit" msgid "Total Credit"
msgstr "Total Crédit" msgstr "Total Crédit"
#: src/view/AccountPanel.cpp:178 #: src/view/AccountPanel.cpp:166
msgid "Total Debit" msgid "Total Debit"
msgstr "Total Débit" msgstr "Total Débit"
@ -468,51 +486,51 @@ msgstr "Utilisateur"
msgid "Users" msgid "Users"
msgstr "Utilisateurs" msgstr "Utilisateurs"
#: src/view/wxUI.cpp:97 #: src/view/wxUI.cpp:110
msgid "april" msgid "april"
msgstr "avril" msgstr "avril"
#: src/view/wxUI.cpp:101 #: src/view/wxUI.cpp:114
msgid "august" msgid "august"
msgstr "août" msgstr "août"
#: src/view/wxUI.cpp:105 #: src/view/wxUI.cpp:118
msgid "december" msgid "december"
msgstr "décembre" msgstr "décembre"
#: src/view/wxUI.cpp:95 #: src/view/wxUI.cpp:108
msgid "february" msgid "february"
msgstr "février" msgstr "février"
#: src/view/wxUI.cpp:94 #: src/view/wxUI.cpp:107
msgid "january" msgid "january"
msgstr "janvier" msgstr "janvier"
#: src/view/wxUI.cpp:100 #: src/view/wxUI.cpp:113
msgid "july" msgid "july"
msgstr "juillet" msgstr "juillet"
#: src/view/wxUI.cpp:99 #: src/view/wxUI.cpp:112
msgid "june" msgid "june"
msgstr "juin" msgstr "juin"
#: src/view/wxUI.cpp:96 #: src/view/wxUI.cpp:109
msgid "march" msgid "march"
msgstr "mars" msgstr "mars"
#: src/view/wxUI.cpp:98 #: src/view/wxUI.cpp:111
msgid "may" msgid "may"
msgstr "mai" msgstr "mai"
#: src/view/wxUI.cpp:104 #: src/view/wxUI.cpp:117
msgid "november" msgid "november"
msgstr "novembre" msgstr "novembre"
#: src/view/wxUI.cpp:103 #: src/view/wxUI.cpp:116
msgid "october" msgid "october"
msgstr "octobre" msgstr "octobre"
#: src/view/wxUI.cpp:102 #: src/view/wxUI.cpp:115
msgid "september" msgid "september"
msgstr "septembre" msgstr "septembre"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-08-14 22:00+0200\n" "POT-Creation-Date: 2010-08-18 20:59+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: src/view/PreferencesPanel.cpp:574 #: src/view/PreferencesPanel.cpp:574 src/view/StatsPanel.cpp:288
msgid " - " msgid " - "
msgstr "" msgstr ""
@ -34,7 +34,7 @@ msgstr ""
msgid " not found, aborting" msgid " not found, aborting"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:936 #: src/view/AccountPanel.cpp:924
msgid " operations ?" msgid " operations ?"
msgstr "" msgstr ""
@ -46,7 +46,7 @@ msgstr ""
msgid "1 entry found" msgid "1 entry found"
msgstr "" msgstr ""
#: src/view/ButtonPanel.cpp:51 #: src/view/ButtonPanel.cpp:52
msgid "About" msgid "About"
msgstr "" msgstr ""
@ -58,15 +58,15 @@ msgstr ""
msgid "Account " msgid "Account "
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:113 #: src/view/AccountPanel.cpp:101
msgid "Account name" msgid "Account name"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:112 #: src/view/AccountPanel.cpp:100
msgid "Account number" msgid "Account number"
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:55 #: src/view/PreferencesPanel.cpp:55 src/view/StatsPanel.cpp:256
msgid "Accounts" msgid "Accounts"
msgstr "" msgstr ""
@ -79,11 +79,11 @@ msgid "Amount to"
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:340 src/view/PreferencesPanel.cpp:581 #: src/view/PreferencesPanel.cpp:340 src/view/PreferencesPanel.cpp:581
#: src/view/AccountPanel.cpp:931 #: src/view/AccountPanel.cpp:919
msgid "Are you sure want to delete " msgid "Are you sure want to delete "
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:449 src/view/AccountPanel.cpp:633 #: src/view/PreferencesPanel.cpp:449 src/view/AccountPanel.cpp:621
#: src/view/SearchPanel.cpp:345 #: src/view/SearchPanel.cpp:345
msgid "Are you sure want to delete : \n" msgid "Are you sure want to delete : \n"
msgstr "" msgstr ""
@ -121,7 +121,7 @@ msgstr ""
msgid "Change password" msgid "Change password"
msgstr "" msgstr ""
#: src/view/ButtonPanel.cpp:50 #: src/view/ButtonPanel.cpp:51
msgid "Change user" msgid "Change user"
msgstr "" msgstr ""
@ -133,7 +133,7 @@ msgstr ""
msgid "Confirm password " msgid "Confirm password "
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:123 #: src/view/StatsPanel.cpp:130 src/view/AccountPanel.cpp:111
msgid "Cost repartition" msgid "Cost repartition"
msgstr "" msgstr ""
@ -141,15 +141,15 @@ msgstr ""
msgid "Credit" msgid "Credit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:193 #: src/view/AccountPanel.cpp:181
msgid "Cur Credit" msgid "Cur Credit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:194 #: src/view/AccountPanel.cpp:182
msgid "Cur Debit" msgid "Cur Debit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:115 #: src/view/AccountPanel.cpp:103
msgid "Current value" msgid "Current value"
msgstr "" msgstr ""
@ -174,7 +174,7 @@ msgid "Default"
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:159 src/view/PreferencesPanel.cpp:209 #: src/view/PreferencesPanel.cpp:159 src/view/PreferencesPanel.cpp:209
#: src/view/AccountPanel.cpp:790 #: src/view/AccountPanel.cpp:778
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
@ -191,7 +191,7 @@ msgstr ""
#: src/view/PreferencesPanel.cpp:336 src/view/PreferencesPanel.cpp:359 #: src/view/PreferencesPanel.cpp:336 src/view/PreferencesPanel.cpp:359
#: src/view/PreferencesPanel.cpp:378 src/view/PreferencesPanel.cpp:468 #: src/view/PreferencesPanel.cpp:378 src/view/PreferencesPanel.cpp:468
#: src/view/PreferencesPanel.cpp:487 src/view/PreferencesPanel.cpp:526 #: src/view/PreferencesPanel.cpp:487 src/view/PreferencesPanel.cpp:526
#: src/view/PreferencesPanel.cpp:532 src/view/AccountPanel.cpp:927 #: src/view/PreferencesPanel.cpp:532 src/view/AccountPanel.cpp:915
#: src/view/UsersDialog.cpp:86 src/view/UsersDialog.cpp:114 #: src/view/UsersDialog.cpp:86 src/view/UsersDialog.cpp:114
#: src/view/SearchPanel.cpp:134 src/view/SearchPanel.cpp:144 #: src/view/SearchPanel.cpp:134 src/view/SearchPanel.cpp:144
#: src/view/SearchPanel.cpp:158 src/view/SearchPanel.cpp:169 #: src/view/SearchPanel.cpp:158 src/view/SearchPanel.cpp:169
@ -202,7 +202,7 @@ msgstr ""
msgid "Error creating original database" msgid "Error creating original database"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:116 #: src/view/AccountPanel.cpp:104
msgid "Final value" msgid "Final value"
msgstr "" msgstr ""
@ -215,11 +215,15 @@ msgstr ""
msgid "Font" msgid "Font"
msgstr "" msgstr ""
#: src/view/StatsPanel.cpp:62
msgid "From"
msgstr ""
#: src/view/GenerateDialog.cpp:45 #: src/view/GenerateDialog.cpp:45
msgid "From " msgid "From "
msgstr "" msgstr ""
#: src/view/GenerateDialog.cpp:31 src/view/AccountPanel.cpp:787 #: src/view/GenerateDialog.cpp:31 src/view/AccountPanel.cpp:775
msgid "Generate month" msgid "Generate month"
msgstr "" msgstr ""
@ -231,7 +235,7 @@ msgstr ""
msgid "Hobbies" msgid "Hobbies"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:114 #: src/view/AccountPanel.cpp:102
msgid "Initial value" msgid "Initial value"
msgstr "" msgstr ""
@ -263,11 +267,15 @@ msgstr ""
msgid "Invalid password" msgid "Invalid password"
msgstr "" msgstr ""
#: src/view/StatsPanel.cpp:303
msgid "Invalide date range"
msgstr ""
#: src/view/PreferencesPanel.cpp:336 #: src/view/PreferencesPanel.cpp:336
msgid "It must be at least one account !" msgid "It must be at least one account !"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:927 #: src/view/AccountPanel.cpp:915
msgid "It must be at least one month !" msgid "It must be at least one month !"
msgstr "" msgstr ""
@ -276,6 +284,7 @@ msgid "Kill me"
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:566 src/view/PreferencesPanel.cpp:569 #: src/view/PreferencesPanel.cpp:566 src/view/PreferencesPanel.cpp:569
#: src/view/StatsPanel.cpp:303
msgid "KissCount" msgid "KissCount"
msgstr "" msgstr ""
@ -337,7 +346,7 @@ msgstr ""
msgid "Operation order" msgid "Operation order"
msgstr "" msgstr ""
#: src/view/ButtonPanel.cpp:46 #: src/view/ButtonPanel.cpp:47
msgid "Operations" msgid "Operations"
msgstr "" msgstr ""
@ -353,7 +362,7 @@ msgstr ""
msgid "Password changed" msgid "Password changed"
msgstr "" msgstr ""
#: src/view/ButtonPanel.cpp:96 #: src/view/ButtonPanel.cpp:102
msgid "" msgid ""
"Personal accounting software\n" "Personal accounting software\n"
"\n" "\n"
@ -365,28 +374,28 @@ msgid "Please retype new password"
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:540 src/view/PreferencesPanel.cpp:574 #: src/view/PreferencesPanel.cpp:540 src/view/PreferencesPanel.cpp:574
#: src/view/ButtonPanel.cpp:49 #: src/view/ButtonPanel.cpp:50
msgid "Preferences" msgid "Preferences"
msgstr "" msgstr ""
#: src/view/ButtonPanel.cpp:52 #: src/view/ButtonPanel.cpp:53
msgid "Quit" msgid "Quit"
msgstr "" msgstr ""
#: src/view/ButtonPanel.cpp:103 #: src/view/ButtonPanel.cpp:109
msgid "Quit KissCount ?" msgid "Quit KissCount ?"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:195 #: src/view/AccountPanel.cpp:183
msgid "Remains" msgid "Remains"
msgstr "" msgstr ""
#: src/view/SearchPanel.cpp:78 src/view/SearchPanel.cpp:239 #: src/view/SearchPanel.cpp:78 src/view/SearchPanel.cpp:239
#: src/view/ButtonPanel.cpp:48 #: src/view/ButtonPanel.cpp:49
msgid "Search" msgid "Search"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:97 #: src/view/StatsPanel.cpp:122 src/view/AccountPanel.cpp:85
msgid "Serie 1" msgid "Serie 1"
msgstr "" msgstr ""
@ -394,19 +403,23 @@ msgstr ""
msgid "Shared" msgid "Shared"
msgstr "" msgstr ""
#: src/view/ButtonPanel.cpp:47 #: src/view/StatsPanel.cpp:288 src/view/ButtonPanel.cpp:48
msgid "Statistics" msgid "Statistics"
msgstr "" msgstr ""
#: src/view/StatsPanel.cpp:69
msgid "To"
msgstr ""
#: src/view/GenerateDialog.cpp:52 #: src/view/GenerateDialog.cpp:52
msgid "To " msgid "To "
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:177 #: src/view/AccountPanel.cpp:165
msgid "Total Credit" msgid "Total Credit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:178 #: src/view/AccountPanel.cpp:166
msgid "Total Debit" msgid "Total Debit"
msgstr "" msgstr ""
@ -431,50 +444,50 @@ msgstr ""
msgid "Users" msgid "Users"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:97 #: src/view/wxUI.cpp:110
msgid "april" msgid "april"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:101 #: src/view/wxUI.cpp:114
msgid "august" msgid "august"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:105 #: src/view/wxUI.cpp:118
msgid "december" msgid "december"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:95 #: src/view/wxUI.cpp:108
msgid "february" msgid "february"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:94 #: src/view/wxUI.cpp:107
msgid "january" msgid "january"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:100 #: src/view/wxUI.cpp:113
msgid "july" msgid "july"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:99 #: src/view/wxUI.cpp:112
msgid "june" msgid "june"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:96 #: src/view/wxUI.cpp:109
msgid "march" msgid "march"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:98 #: src/view/wxUI.cpp:111
msgid "may" msgid "may"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:104 #: src/view/wxUI.cpp:117
msgid "november" msgid "november"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:103 #: src/view/wxUI.cpp:116
msgid "october" msgid "october"
msgstr "" msgstr ""
#: src/view/wxUI.cpp:102 #: src/view/wxUI.cpp:115
msgid "september" msgid "september"
msgstr "" msgstr ""

View File

@ -1071,6 +1071,8 @@ void Database::GetStats(User* user, const wxString& monthFrom, const wxString& y
for (accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++) for (accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++)
{ {
req = wxT("SELECT month, year, amount FROM account_amount WHERE account ='") + accountIt->id + wxT("'"); req = wxT("SELECT month, year, amount FROM account_amount WHERE account ='") + accountIt->id + wxT("'");
req += wxT(" AND (year > '") + yearFrom + wxT("' OR (year == '") + yearFrom + wxT("' AND month >= '") + monthFrom + wxT("'))");
req += wxT(" AND (year < '") + yearTo + wxT("' OR (year == '") + yearTo + wxT("' AND month <= '") + monthTo + wxT("'))");
EXECUTE_SQL_QUERY(req, set, ); EXECUTE_SQL_QUERY(req, set, );
@ -1095,7 +1097,6 @@ void Database::GetStats(User* user, const wxString& monthFrom, const wxString& y
req += wxT(" OR user='") + user->_id + wxT("')"); req += wxT(" OR user='") + user->_id + wxT("')");
req += wxT(" AND (year > '") + yearFrom + wxT("' OR (year == '") + yearFrom + wxT("' AND month >= '") + monthFrom + wxT("'))"); req += wxT(" AND (year > '") + yearFrom + wxT("' OR (year == '") + yearFrom + wxT("' AND month >= '") + monthFrom + wxT("'))");
req += wxT(" AND (year < '") + yearTo + wxT("' OR (year == '") + yearTo + wxT("' AND month <= '") + monthTo + wxT("'))"); req += wxT(" AND (year < '") + yearTo + wxT("' OR (year == '") + yearTo + wxT("' AND month <= '") + monthTo + wxT("'))");
req += wxT(" AND amount < 0"); req += wxT(" AND amount < 0");

View File

@ -19,24 +19,65 @@ along with KissCount. If not, see <http://www.gnu.org/licenses/>.
#include "StatsPanel.h" #include "StatsPanel.h"
StatsPanel::StatsPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), _kiss(kiss), _wxUI(parent) enum {RANGE_ID=1, ACCOUNTS_ID};
BEGIN_EVENT_TABLE(StatsPanel, wxPanel)
EVT_CHOICE(RANGE_ID, StatsPanel::OnRangeChange)
EVT_CHECKLISTBOX(ACCOUNTS_ID, StatsPanel::OnAccountsChange)
END_EVENT_TABLE()
StatsPanel::StatsPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), _kiss(kiss), _wxUI(parent), _plot(NULL), _chart(NULL)
{ {
wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *hbox2 = new wxBoxSizer(wxHORIZONTAL); _hbox2 = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL); wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *vbox2 = new wxBoxSizer(wxVERTICAL); _vbox2 = new wxBoxSizer(wxVERTICAL);
int i; int i;
User* user = _kiss->GetUser(); User* user = _kiss->GetUser();
std::vector<Account>::iterator accountIt; std::vector<Account>::iterator accountIt;
std::vector<Category>::iterator categoryIt; std::vector<Category>::iterator categoryIt;
std::map<int, std::vector<int> > operations;
std::map<int, std::vector<int> >::iterator it;
SetSizer(vbox); SetSizer(vbox);
_monthFrom = new wxChoice (this, -1, wxDefaultPosition, wxDefaultSize, 12, months); _monthFrom = new wxChoice (this, RANGE_ID, wxDefaultPosition, wxDefaultSize, 12, months);
_monthTo = new wxChoice (this, -1, wxDefaultPosition, wxDefaultSize, 12, months); _yearFrom = new wxChoice (this, RANGE_ID);
_monthTo = new wxChoice (this, RANGE_ID, wxDefaultPosition, wxDefaultSize, 12, months);
_yearTo = new wxChoice (this, RANGE_ID);
operations = _kiss->GetAllOperations();
for(i=0, it = operations.begin(); it != operations.end(); it++, i++)
{
_yearFrom->Append(wxString::Format(wxT("%d"), it->first));
_yearTo->Append(wxString::Format(wxT("%d"), it->first));
}
_monthFrom->Select(0);
_monthTo->Select(11);
_yearFrom->Select(i);
_yearTo->Select(i);
wxStaticText* label = new wxStaticText(this, wxID_ANY, _("From"));
hbox->Add(label);
hbox->Add(-1, 10);
hbox->Add(_monthFrom); hbox->Add(_monthFrom);
hbox->Add(_yearFrom);
hbox->Add(-1, 30);
label = new wxStaticText(this, wxID_ANY, _("To"));
hbox->Add(label);
hbox->Add(-1, 10);
hbox->Add(_monthTo); hbox->Add(_monthTo);
hbox->Add(_yearTo);
_account = new wxCheckListBox(this, ACCOUNTS_ID);
for(i=0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++, i++)
{
_account->Append(accountIt->name);
_account->Check(i);
}
_categories = new wxString[user->GetCategoriesNumber()] ; _categories = new wxString[user->GetCategoriesNumber()] ;
for(i=0, categoryIt = user->_categories.begin(); for(i=0, categoryIt = user->_categories.begin();
@ -65,7 +106,9 @@ StatsPanel::StatsPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), _ki
_statsGrid->SetCellAlignment(i, 1, wxALIGN_RIGHT, wxALIGN_CENTRE); _statsGrid->SetCellAlignment(i, 1, wxALIGN_RIGHT, wxALIGN_CENTRE);
} }
vbox2->Add(_statsGrid); _vbox2->Add(_account);
_vbox2->Add(-1, 10);
_vbox2->Add(_statsGrid);
_pie = new PiePlot(); _pie = new PiePlot();
@ -90,20 +133,21 @@ StatsPanel::StatsPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), _ki
chart->SetMinSize(// chart->GetSize() chart->SetMinSize(// chart->GetSize()
wxSize(200,250)); wxSize(200,250));
UpdateStats(hbox2); wxCommandEvent event ;
OnRangeChange(event);
vbox2->Add(chart); _vbox2->Add(-1, 10);
_vbox2->Add(chart);
hbox2->Add(vbox2);
vbox->Add(hbox); vbox->Add(hbox);
vbox->Add(hbox2); vbox->Add(_hbox2);
Fit(); Fit();
Hide(); Hide();
} }
void StatsPanel::UpdateStats(wxBoxSizer *hbox2) void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearTo)
{ {
std::map<wxString, std::map<int, std::map<int, double> > > accountAmounts; std::map<wxString, std::map<int, std::map<int, double> > > accountAmounts;
std::map<wxString, double> categories; std::map<wxString, double> categories;
@ -111,12 +155,19 @@ void StatsPanel::UpdateStats(wxBoxSizer *hbox2)
std::map<wxString, std::map<int, std::map<int, double> > >::iterator accountIdIt; std::map<wxString, std::map<int, std::map<int, double> > >::iterator accountIdIt;
std::map<int, std::map<int, double> >::iterator accountYearIt; std::map<int, std::map<int, double> >::iterator accountYearIt;
double total; double total;
int size, i, a, b, percents; int size, i, a, b, percents, account;
double *amounts; double *amounts;
User* user = _kiss->GetUser();
wxString value; wxString value;
User* user = _kiss->GetUser();
_kiss->GetStats(0, 2010, 11, 2010, &accountAmounts, &categories); if (_chart)
{
_hbox2->Detach(_chart);
_hbox2->Detach(_vbox2);
delete _chart;
}
_kiss->GetStats(monthFrom, yearFrom, monthTo, yearTo, &accountAmounts, &categories);
// first step: create plot // first step: create plot
_plot = new XYPlot(); _plot = new XYPlot();
@ -124,9 +175,30 @@ void StatsPanel::UpdateStats(wxBoxSizer *hbox2)
// create dataset // create dataset
XYSimpleDataset *dataset = new XYSimpleDataset(); XYSimpleDataset *dataset = new XYSimpleDataset();
// add two series // Line on 0 all over the years
for (i = 0, accountIdIt = accountAmounts.begin(); accountIdIt != accountAmounts.end(); accountIdIt++, i++) size = ((yearTo - yearFrom) + 1) * 12;
amounts = new double[size*2];
for (a=0; a<(size/12); a++)
{ {
for(b=0; b<12; b++)
{
amounts[a*12*2+b*2+0] = a*12+b;
amounts[a*12*2+b*2+1] = 0;
}
}
dataset->AddSerie((double *) amounts, size);
delete[] amounts;
for (account = 0, i = 0, accountIdIt = accountAmounts.begin(); accountIdIt != accountAmounts.end();
accountIdIt++, i++, account++)
{
if (!((wxCheckListBox*)_account)->IsChecked(account))
{
i-- ;
continue;
}
size = accountAmounts[accountIdIt->first].size(); size = accountAmounts[accountIdIt->first].size();
amounts = new double[size*12*2]; amounts = new double[size*12*2];
size = 0; size = 0;
@ -145,12 +217,12 @@ void StatsPanel::UpdateStats(wxBoxSizer *hbox2)
} }
dataset->AddSerie((double *) amounts, size); dataset->AddSerie((double *) amounts, size);
// set serie names to be displayed on legend // set serie names to be displayed on legend
dataset->SetSerieName(i, user->GetAccountName(accountIdIt->first)); dataset->SetSerieName(i+1, user->GetAccountName(accountIdIt->first));
delete[] amounts; delete[] amounts;
} }
// create line renderer and set it to dataset // create line renderer and set it to dataset
XYLineRenderer *renderer = new XYLineRenderer(); XYLineRenderer *renderer = new XYLineRenderer(true, true);
dataset->SetRenderer(renderer); dataset->SetRenderer(renderer);
// add our dataset to plot // add our dataset to plot
@ -168,26 +240,17 @@ void StatsPanel::UpdateStats(wxBoxSizer *hbox2)
_plot->LinkDataVerticalAxis(0, 0); _plot->LinkDataVerticalAxis(0, 0);
_plot->LinkDataHorizontalAxis(0, 0); _plot->LinkDataHorizontalAxis(0, 0);
// create line marker
LineMarker *lineMarker = new LineMarker(wxColour(255, 0, 0), 2);
// set value to be marked, in our case horizontal value 15
lineMarker->SetHorizontalLine(25);
// and add marker to dataset
dataset->AddMarker(lineMarker);
// set legend // set legend
_plot->SetLegend(new Legend(wxCENTER, wxRIGHT)); _plot->SetLegend(new Legend(wxCENTER, wxRIGHT));
wxChartPanel* chart = new wxChartPanel(this); _chart = new wxChartPanel(this);
chart->SetChart(new Chart(_plot, _("Accounts"))); _chart->SetChart(new Chart(_plot, _("Accounts")));
chart->Fit(); _chart->Fit();
chart->Layout(); _chart->Layout();
chart->SetMinSize(// chart->GetSize() _chart->SetMinSize(// chart->GetSize()
wxSize(750,550)); wxSize(750,550));
hbox2->Add(chart); _hbox2->Add(_chart);
total = 0.0; total = 0.0;
for(categoriesIt = categories.begin(); categoriesIt != categories.end(); categoriesIt++) for(categoriesIt = categories.begin(); categoriesIt != categories.end(); categoriesIt++)
@ -205,6 +268,10 @@ void StatsPanel::UpdateStats(wxBoxSizer *hbox2)
_statsGrid->AutoSizeColumn(1, true); _statsGrid->AutoSizeColumn(1, true);
_pie->DatasetChanged(_dataset); _pie->DatasetChanged(_dataset);
_hbox2->Add(_vbox2);
Layout();
} }
void StatsPanel::OnShow(wxShowEvent& event) void StatsPanel::OnShow(wxShowEvent& event)
@ -212,3 +279,26 @@ void StatsPanel::OnShow(wxShowEvent& event)
_wxUI->SetTitle(_kiss->GetUser()->_name + _(" - ") + _("Statistics")); _wxUI->SetTitle(_kiss->GetUser()->_name + _(" - ") + _("Statistics"));
} }
void StatsPanel::OnRangeChange(wxCommandEvent& event)
{
int monthFrom, monthTo, yearFrom, yearTo;
monthFrom = _monthFrom->GetCurrentSelection();
_yearFrom->GetStringSelection().ToLong((long*)&yearFrom);
monthTo = _monthTo->GetCurrentSelection();
_yearTo->GetStringSelection().ToLong((long*)&yearTo);
if (yearTo > yearFrom ||
(yearFrom == yearTo && monthFrom >= monthTo))
{
wxMessageBox(_("Invalide date range"), _("KissCount"), wxICON_ERROR | wxOK);
return;
}
UpdateStats(monthFrom, yearFrom, monthTo, yearTo);
}
void StatsPanel::OnAccountsChange(wxCommandEvent& event)
{
OnRangeChange(event);
}

View File

@ -61,11 +61,16 @@ class StatsPanel: public wxPanel //public wxScrolledWindow
XYPlot *_plot ; XYPlot *_plot ;
wxString* _categories; wxString* _categories;
std::map<wxString, int> _categoriesIndexes; std::map<wxString, int> _categoriesIndexes;
wxBoxSizer *_hbox2, *_vbox2;
wxChartPanel* _chart;
wxCheckListBox* _account;
void UpdateStats(wxBoxSizer *); void UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearTo);
//DECLARE_EVENT_TABLE(); void OnRangeChange(wxCommandEvent& event);
void OnAccountsChange(wxCommandEvent& event);
DECLARE_EVENT_TABLE();
}; };
#endif #endif