Add check mode

Fix bug with KissCount title on start
This commit is contained in:
Grégory Soutadé 2010-08-21 11:49:03 +02:00
parent d12e00c6fb
commit 9f7d858bc3
10 changed files with 179 additions and 81 deletions

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-18 20:59+0200\n" "POT-Creation-Date: 2010-08-21 11:44+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,7 +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 #: src/view/StatsPanel.cpp:279
msgid " - " msgid " - "
msgstr " - " msgstr " - "
@ -40,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:924 #: src/view/AccountPanel.cpp:982
msgid " operations ?" msgid " operations ?"
msgstr " opérations ?" msgstr " opérations ?"
@ -66,16 +66,16 @@ msgstr "Compte"
msgid "Account " msgid "Account "
msgstr "Le compte " msgstr "Le compte "
#: src/view/AccountPanel.cpp:101 #: src/view/AccountPanel.cpp:102
msgid "Account name" msgid "Account name"
msgstr "Nom du compte" msgstr "Nom du compte"
#: src/view/AccountPanel.cpp:100 #: src/view/AccountPanel.cpp:101
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 #: src/view/StatsPanel.cpp:247
msgid "Accounts" msgid "Accounts"
msgstr "Comptes" msgstr "Comptes"
@ -89,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:919 #: src/view/AccountPanel.cpp:977
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:621 #: src/view/AccountPanel.cpp:669
#: 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"
@ -139,6 +139,10 @@ msgstr "Changer le mot de passe"
msgid "Change user" msgid "Change user"
msgstr "Changer d'utilisateur" msgstr "Changer d'utilisateur"
#: src/view/AccountPanel.cpp:118
msgid "Check mode"
msgstr "Mode rapprochement"
#: src/view/PreferencesPanel.cpp:207 #: src/view/PreferencesPanel.cpp:207
msgid "Color" msgid "Color"
msgstr "Couleur" msgstr "Couleur"
@ -148,7 +152,7 @@ msgid "Confirm password "
msgstr "Confirmer le mot de passe" msgstr "Confirmer le mot de passe"
#: src/view/StatsPanel.cpp:130 #: src/view/StatsPanel.cpp:130
#: src/view/AccountPanel.cpp:111 #: src/view/AccountPanel.cpp:112
msgid "Cost repartition" msgid "Cost repartition"
msgstr "Répartition des coûts" msgstr "Répartition des coûts"
@ -156,15 +160,15 @@ msgstr "Répartition des coûts"
msgid "Credit" msgid "Credit"
msgstr "Crédit" msgstr "Crédit"
#: src/view/AccountPanel.cpp:181 #: src/view/AccountPanel.cpp:187
msgid "Cur Credit" msgid "Cur Credit"
msgstr "Cur Crédit" msgstr "Cur Crédit"
#: src/view/AccountPanel.cpp:182 #: src/view/AccountPanel.cpp:188
msgid "Cur Debit" msgid "Cur Debit"
msgstr "Cur Débit" msgstr "Cur Débit"
#: src/view/AccountPanel.cpp:103 #: src/view/AccountPanel.cpp:104
msgid "Current value" msgid "Current value"
msgstr "Valeur courante" msgstr "Valeur courante"
@ -190,7 +194,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:778 #: src/view/AccountPanel.cpp:836
msgid "Delete" msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
@ -214,7 +218,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:915 #: src/view/AccountPanel.cpp:973
#: 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
@ -228,12 +232,12 @@ 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:104 #: src/view/AccountPanel.cpp:105
msgid "Final value" msgid "Final value"
msgstr "Valeur finale" msgstr "Valeur finale"
#: src/model/Database.cpp:260 #: src/model/Database.cpp:260
#: src/controller/KissCount.cpp:259 #: src/controller/KissCount.cpp:276
#: src/view/GridAccount.cpp:126 #: src/view/GridAccount.cpp:126
msgid "Fix" msgid "Fix"
msgstr "Fixe" msgstr "Fixe"
@ -251,19 +255,19 @@ msgid "From "
msgstr "De" msgstr "De"
#: src/view/GenerateDialog.cpp:31 #: src/view/GenerateDialog.cpp:31
#: src/view/AccountPanel.cpp:775 #: src/view/AccountPanel.cpp:833
msgid "Generate month" msgid "Generate month"
msgstr "Générer mois" msgstr "Générer mois"
#: src/controller/KissCount.cpp:261 #: src/controller/KissCount.cpp:278
msgid "Groceries" msgid "Groceries"
msgstr "Courses" msgstr "Courses"
#: src/controller/KissCount.cpp:263 #: src/controller/KissCount.cpp:280
msgid "Hobbies" msgid "Hobbies"
msgstr "Loisirs" msgstr "Loisirs"
#: src/view/AccountPanel.cpp:102 #: src/view/AccountPanel.cpp:103
msgid "Initial value" msgid "Initial value"
msgstr "Valeur initiale" msgstr "Valeur initiale"
@ -295,7 +299,7 @@ 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 #: src/view/StatsPanel.cpp:294
msgid "Invalide date range" msgid "Invalide date range"
msgstr "Intervalle de temps invalide" msgstr "Intervalle de temps invalide"
@ -303,7 +307,7 @@ msgstr "Intervalle de temps invalide"
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:915 #: src/view/AccountPanel.cpp:973
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"
@ -313,7 +317,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 #: src/view/StatsPanel.cpp:294
msgid "KissCount" msgid "KissCount"
msgstr "KissCount" msgstr "KissCount"
@ -370,7 +374,7 @@ msgstr "OK"
msgid "Old password " msgid "Old password "
msgstr "Ancien mot de passe" msgstr "Ancien mot de passe"
#: src/controller/KissCount.cpp:265 #: src/controller/KissCount.cpp:282
msgid "Operating exepense" msgid "Operating exepense"
msgstr "Frais de fonctionnement" msgstr "Frais de fonctionnement"
@ -382,7 +386,7 @@ msgstr "Ordre des opérations"
msgid "Operations" msgid "Operations"
msgstr "Opérations" msgstr "Opérations"
#: src/controller/KissCount.cpp:269 #: src/controller/KissCount.cpp:286
msgid "Other" msgid "Other"
msgstr "Autres" msgstr "Autres"
@ -422,7 +426,7 @@ msgstr "Quitter"
msgid "Quit KissCount ?" msgid "Quit KissCount ?"
msgstr "Quitter KissCount ?" msgstr "Quitter KissCount ?"
#: src/view/AccountPanel.cpp:183 #: src/view/AccountPanel.cpp:189
msgid "Remains" msgid "Remains"
msgstr "Restant" msgstr "Restant"
@ -433,7 +437,7 @@ msgid "Search"
msgstr "Chercher" msgstr "Chercher"
#: src/view/StatsPanel.cpp:122 #: src/view/StatsPanel.cpp:122
#: src/view/AccountPanel.cpp:85 #: src/view/AccountPanel.cpp:86
msgid "Serie 1" msgid "Serie 1"
msgstr "Série 1" msgstr "Série 1"
@ -441,7 +445,7 @@ msgstr "Série 1"
msgid "Shared" msgid "Shared"
msgstr "Partagé" msgstr "Partagé"
#: src/view/StatsPanel.cpp:288 #: src/view/StatsPanel.cpp:279
#: src/view/ButtonPanel.cpp:48 #: src/view/ButtonPanel.cpp:48
msgid "Statistics" msgid "Statistics"
msgstr "Statistiques" msgstr "Statistiques"
@ -454,15 +458,15 @@ msgstr "A"
msgid "To " msgid "To "
msgstr "A" msgstr "A"
#: src/view/AccountPanel.cpp:165 #: src/view/AccountPanel.cpp:171
msgid "Total Credit" msgid "Total Credit"
msgstr "Total Crédit" msgstr "Total Crédit"
#: src/view/AccountPanel.cpp:166 #: src/view/AccountPanel.cpp:172
msgid "Total Debit" msgid "Total Debit"
msgstr "Total Débit" msgstr "Total Débit"
#: src/controller/KissCount.cpp:267 #: src/controller/KissCount.cpp:284
msgid "Unexpected" msgid "Unexpected"
msgstr "Exceptionnel" msgstr "Exceptionnel"

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-18 20:59+0200\n" "POT-Creation-Date: 2010-08-21 11:44+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/StatsPanel.cpp:288 #: src/view/PreferencesPanel.cpp:574 src/view/StatsPanel.cpp:279
msgid " - " msgid " - "
msgstr "" msgstr ""
@ -34,7 +34,7 @@ msgstr ""
msgid " not found, aborting" msgid " not found, aborting"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:924 #: src/view/AccountPanel.cpp:982
msgid " operations ?" msgid " operations ?"
msgstr "" msgstr ""
@ -58,15 +58,15 @@ msgstr ""
msgid "Account " msgid "Account "
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:101 #: src/view/AccountPanel.cpp:102
msgid "Account name" msgid "Account name"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:100 #: src/view/AccountPanel.cpp:101
msgid "Account number" msgid "Account number"
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:55 src/view/StatsPanel.cpp:256 #: src/view/PreferencesPanel.cpp:55 src/view/StatsPanel.cpp:247
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:919 #: src/view/AccountPanel.cpp:977
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:621 #: src/view/PreferencesPanel.cpp:449 src/view/AccountPanel.cpp:669
#: 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 ""
@ -125,6 +125,10 @@ msgstr ""
msgid "Change user" msgid "Change user"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:118
msgid "Check mode"
msgstr ""
#: src/view/PreferencesPanel.cpp:207 #: src/view/PreferencesPanel.cpp:207
msgid "Color" msgid "Color"
msgstr "" msgstr ""
@ -133,7 +137,7 @@ msgstr ""
msgid "Confirm password " msgid "Confirm password "
msgstr "" msgstr ""
#: src/view/StatsPanel.cpp:130 src/view/AccountPanel.cpp:111 #: src/view/StatsPanel.cpp:130 src/view/AccountPanel.cpp:112
msgid "Cost repartition" msgid "Cost repartition"
msgstr "" msgstr ""
@ -141,15 +145,15 @@ msgstr ""
msgid "Credit" msgid "Credit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:181 #: src/view/AccountPanel.cpp:187
msgid "Cur Credit" msgid "Cur Credit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:182 #: src/view/AccountPanel.cpp:188
msgid "Cur Debit" msgid "Cur Debit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:103 #: src/view/AccountPanel.cpp:104
msgid "Current value" msgid "Current value"
msgstr "" msgstr ""
@ -174,7 +178,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:778 #: src/view/AccountPanel.cpp:836
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
@ -191,7 +195,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:915 #: src/view/PreferencesPanel.cpp:532 src/view/AccountPanel.cpp:973
#: 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,11 +206,11 @@ msgstr ""
msgid "Error creating original database" msgid "Error creating original database"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:104 #: src/view/AccountPanel.cpp:105
msgid "Final value" msgid "Final value"
msgstr "" msgstr ""
#: src/model/Database.cpp:260 src/controller/KissCount.cpp:259 #: src/model/Database.cpp:260 src/controller/KissCount.cpp:276
#: src/view/GridAccount.cpp:126 #: src/view/GridAccount.cpp:126
msgid "Fix" msgid "Fix"
msgstr "" msgstr ""
@ -223,19 +227,19 @@ msgstr ""
msgid "From " msgid "From "
msgstr "" msgstr ""
#: src/view/GenerateDialog.cpp:31 src/view/AccountPanel.cpp:775 #: src/view/GenerateDialog.cpp:31 src/view/AccountPanel.cpp:833
msgid "Generate month" msgid "Generate month"
msgstr "" msgstr ""
#: src/controller/KissCount.cpp:261 #: src/controller/KissCount.cpp:278
msgid "Groceries" msgid "Groceries"
msgstr "" msgstr ""
#: src/controller/KissCount.cpp:263 #: src/controller/KissCount.cpp:280
msgid "Hobbies" msgid "Hobbies"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:102 #: src/view/AccountPanel.cpp:103
msgid "Initial value" msgid "Initial value"
msgstr "" msgstr ""
@ -267,7 +271,7 @@ msgstr ""
msgid "Invalid password" msgid "Invalid password"
msgstr "" msgstr ""
#: src/view/StatsPanel.cpp:303 #: src/view/StatsPanel.cpp:294
msgid "Invalide date range" msgid "Invalide date range"
msgstr "" msgstr ""
@ -275,7 +279,7 @@ msgstr ""
msgid "It must be at least one account !" msgid "It must be at least one account !"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:915 #: src/view/AccountPanel.cpp:973
msgid "It must be at least one month !" msgid "It must be at least one month !"
msgstr "" msgstr ""
@ -284,7 +288,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 #: src/view/StatsPanel.cpp:294
msgid "KissCount" msgid "KissCount"
msgstr "" msgstr ""
@ -338,7 +342,7 @@ msgstr ""
msgid "Old password " msgid "Old password "
msgstr "" msgstr ""
#: src/controller/KissCount.cpp:265 #: src/controller/KissCount.cpp:282
msgid "Operating exepense" msgid "Operating exepense"
msgstr "" msgstr ""
@ -350,7 +354,7 @@ msgstr ""
msgid "Operations" msgid "Operations"
msgstr "" msgstr ""
#: src/controller/KissCount.cpp:269 #: src/controller/KissCount.cpp:286
msgid "Other" msgid "Other"
msgstr "" msgstr ""
@ -386,7 +390,7 @@ msgstr ""
msgid "Quit KissCount ?" msgid "Quit KissCount ?"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:183 #: src/view/AccountPanel.cpp:189
msgid "Remains" msgid "Remains"
msgstr "" msgstr ""
@ -395,7 +399,7 @@ msgstr ""
msgid "Search" msgid "Search"
msgstr "" msgstr ""
#: src/view/StatsPanel.cpp:122 src/view/AccountPanel.cpp:85 #: src/view/StatsPanel.cpp:122 src/view/AccountPanel.cpp:86
msgid "Serie 1" msgid "Serie 1"
msgstr "" msgstr ""
@ -403,7 +407,7 @@ msgstr ""
msgid "Shared" msgid "Shared"
msgstr "" msgstr ""
#: src/view/StatsPanel.cpp:288 src/view/ButtonPanel.cpp:48 #: src/view/StatsPanel.cpp:279 src/view/ButtonPanel.cpp:48
msgid "Statistics" msgid "Statistics"
msgstr "" msgstr ""
@ -415,15 +419,15 @@ msgstr ""
msgid "To " msgid "To "
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:165 #: src/view/AccountPanel.cpp:171
msgid "Total Credit" msgid "Total Credit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:166 #: src/view/AccountPanel.cpp:172
msgid "Total Debit" msgid "Total Debit"
msgstr "" msgstr ""
#: src/controller/KissCount.cpp:267 #: src/controller/KissCount.cpp:284
msgid "Unexpected" msgid "Unexpected"
msgstr "" msgstr ""

View File

@ -365,3 +365,8 @@ void KissCount::GetStats(int monthFrom, int yearFrom, int monthTo, int yearTo,
_db->GetStats(_user, monthF, yearF, monthT, yearT, accountAmounts, categories); _db->GetStats(_user, monthF, yearF, monthT, yearT, accountAmounts, categories);
} }
std::map<wxString, double>* KissCount::GetNotChecked(int month, int year)
{
return _db->GetNotChecked(_user, month, year);
}

View File

@ -80,6 +80,8 @@ class KissCount
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);
std::map<wxString, double>* GetNotChecked(int month, int year);
private: private:
wxUI* _wxUI; wxUI* _wxUI;
Database* _db; Database* _db;

View File

@ -411,7 +411,7 @@ void Database::LinkOrUnlinkOperation(Operation& op)
req += wxT(" AND month='") + wxString::Format(wxT("%d"), op.month) + wxT("'"); req += wxT(" AND month='") + wxString::Format(wxT("%d"), op.month) + wxT("'");
req += wxT(" AND year='") + wxString::Format(wxT("%d"), op.year) + wxT("'"); req += wxT(" AND year='") + wxString::Format(wxT("%d"), op.year) + wxT("'");
req += wxT(" AND amount='") + DoubleToString(-op.amount) + wxT("'"); req += wxT(" AND amount='") + DoubleToString(-op.amount) + wxT("'");
req += wxT(" AND transfert=''"); req += wxT(" AND (transfert='' OR transfert IS NULL)");
EXECUTE_SQL_QUERY(req, set, ); EXECUTE_SQL_QUERY(req, set, );
@ -1196,8 +1196,8 @@ void Database::GetStats(User* user, const wxString& monthFrom, const wxString& y
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 (transfert='' OR transfert IS NULL)");
req += wxT(" AND amount < 0"); req += wxT(" AND amount < 0");
req += wxT(" AND transfert=''");
EXECUTE_SQL_QUERY(req, set, ); EXECUTE_SQL_QUERY(req, set, );
@ -1209,3 +1209,28 @@ void Database::GetStats(User* user, const wxString& monthFrom, const wxString& y
} }
} }
} }
std::map<wxString, double>* Database::GetNotChecked(User* user, int month, int year)
{
std::vector<Account>::iterator accountIt;
std::map<wxString, double>* res = new std::map<wxString, double>;
wxSQLite3ResultSet set;
wxString req;
for (accountIt = user->_accounts.begin() ;accountIt != user->_accounts.end(); accountIt++)
{
req = wxT("SELECT SUM(amount) AS amount FROM operation WHERE account='") + accountIt->id + wxT("'");
req += wxT(" AND checked='0'");
req += wxT(" AND (year < '") + wxString::Format(wxT("%d"), year) + wxT("'") ;
req += wxT(" OR (year == '") + wxString::Format(wxT("%d"), year) + wxT("'") ;
req += wxT(" AND month < '") + wxString::Format(wxT("%d"), month) + wxT("'") ;
req += wxT("))");
EXECUTE_SQL_QUERY_WITH_CODE(req, set, NULL, delete res, delete res);
if (set.NextRow())
(*res)[accountIt->id] = set.GetDouble(wxT("amount"));
}
return res;
}

View File

@ -78,6 +78,8 @@ class Database
void KillMe(User* user); void KillMe(User* user);
bool GetOperation(const wxString& id, Operation* op); bool GetOperation(const wxString& id, Operation* op);
std::map<wxString, double>* GetNotChecked(User* user, int month, int year);
private: private:
wxSQLite3Database _db; wxSQLite3Database _db;

View File

@ -21,7 +21,7 @@ along with KissCount. If not, see <http://www.gnu.org/licenses/>.
enum {ACCOUNT_NUMBER, ACCOUNT_NAME, ACCOUNT_INIT, ACCOUNT_CUR, ACCOUNT_FINAL, NUMBER_COLS_ACCOUNTS}; enum {ACCOUNT_NUMBER, ACCOUNT_NAME, ACCOUNT_INIT, ACCOUNT_CUR, ACCOUNT_FINAL, NUMBER_COLS_ACCOUNTS};
enum {CUR_CREDIT, CUR_DEBIT, TOTAL_CREDIT, TOTAL_DEBIT, REMAINS, STATS_ROW, CATS_STATS}; enum {CUR_CREDIT, CUR_DEBIT, TOTAL_CREDIT, TOTAL_DEBIT, REMAINS, STATS_ROW, CATS_STATS};
enum {CALENDAR_TREE_ID=1, OPS_GRID_ID, CALENDAR_ID, ACCOUNTS_GRID_ID, MENU_GENERATE_ID, MENU_DELETE_ID}; enum {CALENDAR_TREE_ID=1, OPS_GRID_ID, CALENDAR_ID, ACCOUNTS_GRID_ID, MENU_GENERATE_ID, MENU_DELETE_ID, CHECK_MODE_ID};
BEGIN_EVENT_TABLE(AccountPanel, wxPanel) BEGIN_EVENT_TABLE(AccountPanel, wxPanel)
EVT_GRID_CMD_CELL_CHANGE(OPS_GRID_ID, AccountPanel::OnOperationModified) EVT_GRID_CMD_CELL_CHANGE(OPS_GRID_ID, AccountPanel::OnOperationModified)
@ -33,6 +33,7 @@ EVT_MENU(MENU_GENERATE_ID, AccountPanel::OnMenuGenerate)
EVT_MENU(MENU_DELETE_ID, AccountPanel::OnMenuDelete) EVT_MENU(MENU_DELETE_ID, AccountPanel::OnMenuDelete)
EVT_SHOW(AccountPanel::OnShow) EVT_SHOW(AccountPanel::OnShow)
EVT_CALENDAR_SEL_CHANGED(CALENDAR_ID, AccountPanel::OnCalendarChange) EVT_CALENDAR_SEL_CHANGED(CALENDAR_ID, AccountPanel::OnCalendarChange)
EVT_CHECKBOX(CHECK_MODE_ID, AccountPanel::OnCheckMode)
END_EVENT_TABLE() END_EVENT_TABLE()
AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : wxScrolledWindow(&(*parent)), _curMonth(-1), _curYear(-1), _kiss(kiss), _wxUI(parent), _tree(this, CALENDAR_TREE_ID, wxDefaultPosition, wxDefaultSize, wxTR_HIDE_ROOT) AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : wxScrolledWindow(&(*parent)), _curMonth(-1), _curYear(-1), _kiss(kiss), _wxUI(parent), _tree(this, CALENDAR_TREE_ID, wxDefaultPosition, wxDefaultSize, wxTR_HIDE_ROOT)
@ -113,6 +114,9 @@ AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : wxScrolledWindow(&(*
chart->Layout(); chart->Layout();
chart->SetMinSize(// chart->GetSize() chart->SetMinSize(// chart->GetSize()
wxSize(200,250)); wxSize(200,250));
_checkCheckMode = new wxCheckBox(this, CHECK_MODE_ID, _("Check mode"));
hbox->Add(&_tree, 0); hbox->Add(&_tree, 0);
hbox2->Add(_accountsGrid, 0); hbox2->Add(_accountsGrid, 0);
hbox2->Add(_calendar, 0); hbox2->Add(_calendar, 0);
@ -124,6 +128,8 @@ AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : wxScrolledWindow(&(*
vbox->Add(-1, 10); vbox->Add(-1, 10);
vbox->Add(chart, 0); vbox->Add(chart, 0);
hbox->Add(-1, 10); hbox->Add(-1, 10);
vbox->Add(_checkCheckMode, 0);
hbox->Add(-1, 10);
hbox->Add(vbox, 0); hbox->Add(vbox, 0);
ChangeUser(); ChangeUser();
@ -437,12 +443,20 @@ void AccountPanel::UpdateStats()
int i; int i;
User* user = _kiss->GetUser(); User* user = _kiss->GetUser();
std::vector<Operation>::iterator it; std::vector<Operation>::iterator it;
double curCredit, curDebit, totalCredit, totalDebit, remains, value, percents; double curCredit, curDebit, totalCredit, totalDebit, remains, value, value2, percents;
std::map<wxString, double> curAccountAmount, finalAccountAmount; std::map<wxString, double> curAccountAmount, finalAccountAmount;
std::map<wxString, double>::iterator doubleIt; std::map<wxString, double>::iterator doubleIt;
std::map<wxString, int>::iterator intIt; std::map<wxString, int>::iterator intIt;
std::vector<Account>::iterator accountIt; std::vector<Account>::iterator accountIt;
unsigned int day; unsigned int day;
bool checkMode = _checkCheckMode->IsChecked();
std::map<wxString, double>* notChecked = NULL;
if (checkMode)
{
notChecked = _kiss->GetNotChecked(_curMonth, _curYear);
}
day = _calendar->GetDate().GetDay()-1; day = _calendar->GetDate().GetDay()-1;
curCredit = curDebit = totalCredit = totalDebit = 0.0; curCredit = curDebit = totalCredit = totalDebit = 0.0;
@ -458,27 +472,35 @@ void AccountPanel::UpdateStats()
for (it=_curOperations->begin(); it!=_curOperations->end(); it++) for (it=_curOperations->begin(); it!=_curOperations->end(); it++)
{ {
if (it->transfert.Length()) continue;
if (it->amount > 0) if (it->amount > 0)
{ {
if (day >= it->day) if (day >= it->day)
{ {
curCredit += it->amount; if (!it->transfert.Length())
curAccountAmount[it->account] += it->amount; curCredit += it->amount;
if (!checkMode || (checkMode && it->checked))
curAccountAmount[it->account] += it->amount;
} }
totalCredit += it->amount; if (!it->transfert.Length())
finalAccountAmount[it->account] += it->amount; totalCredit += it->amount;
if (!checkMode || (checkMode && it->checked))
finalAccountAmount[it->account] += it->amount;
} }
else else
{ {
_categoriesValues[_categoriesIndexes[user->GetCategoryName(it->category)]] += -it->amount ; if (!it->transfert.Length())
_categoriesValues[_categoriesIndexes[user->GetCategoryName(it->category)]] += -it->amount ;
if (day >= it->day) if (day >= it->day)
{ {
curDebit += -it->amount; if (!it->transfert.Length())
curAccountAmount[it->account] += it->amount; curDebit += -it->amount;
if (!checkMode || (checkMode && it->checked))
curAccountAmount[it->account] += it->amount;
} }
totalDebit += -it->amount; if (!it->transfert.Length())
finalAccountAmount[it->account] += it->amount; totalDebit += -it->amount;
if (!checkMode || (checkMode && it->checked))
finalAccountAmount[it->account] += it->amount;
} }
} }
@ -499,16 +521,41 @@ void AccountPanel::UpdateStats()
for (i=0, accountIt=user->_accounts.begin(); accountIt!=user->_accounts.end(); accountIt++, i++) for (i=0, accountIt=user->_accounts.begin(); accountIt!=user->_accounts.end(); accountIt++, i++)
{ {
value = curAccountAmount[accountIt->id]; if (!checkMode || !notChecked)
_accountsGrid->SetCellValue(i, ACCOUNT_CUR, wxString::Format(wxT("%.2lf"), value)); {
_accountsGrid->SetCellTextColour(i, ACCOUNT_CUR, (value >= 0.0) ? wxColor(0x00, 0x00, 0x00) : wxColor(0xFF, 0x00, 0x00)); value = _accountsInitValues[accountIt->id];
value = finalAccountAmount[accountIt->id]; _accountsGrid->SetCellValue(i, ACCOUNT_INIT, wxString::Format(wxT("%.2lf"), value));
_accountsGrid->SetCellValue(i, ACCOUNT_FINAL, wxString::Format(wxT("%.2lf"), value)); value = curAccountAmount[accountIt->id];
_accountsGrid->SetCellValue(i, ACCOUNT_CUR, wxString::Format(wxT("%.2lf"), value));
_accountsGrid->SetCellTextColour(i, ACCOUNT_CUR, (value >= 0.0) ? wxColor(0x00, 0x00, 0x00) : wxColor(0xFF, 0x00, 0x00));
value = finalAccountAmount[accountIt->id];
_accountsGrid->SetCellValue(i, ACCOUNT_FINAL, wxString::Format(wxT("%.2lf"), value));
}
else
{
value = _accountsInitValues[accountIt->id];
value2 = (*notChecked)[accountIt->id];
_accountsGrid->SetCellValue(i, ACCOUNT_INIT, wxString::Format(wxT("%.2lf (%.2lf)"), value, value+value2));
value = curAccountAmount[accountIt->id];
_accountsGrid->SetCellValue(i, ACCOUNT_CUR, wxString::Format(wxT("%.2lf (%.2lf)"), value, value+value2));
_accountsGrid->SetCellTextColour(i, ACCOUNT_CUR, (value >= 0.0) ? wxColor(0x00, 0x00, 0x00) : wxColor(0xFF, 0x00, 0x00));
value = finalAccountAmount[accountIt->id];
_accountsGrid->SetCellValue(i, ACCOUNT_FINAL, wxString::Format(wxT("%.2lf (%.2lf)"), value, value+value2));
}
} }
_accountsGrid->AutoSizeColumn(ACCOUNT_INIT, true);
_accountsGrid->AutoSizeColumn(ACCOUNT_CUR, true);
_accountsGrid->AutoSizeColumn(ACCOUNT_FINAL, true);
if (notChecked) delete notChecked;
_statsGrid->AutoSizeColumn(1, true); _statsGrid->AutoSizeColumn(1, true);
_pie->DatasetChanged(_dataset); _pie->DatasetChanged(_dataset);
Layout();
} }
void AccountPanel::OnOperationModified(wxGridEvent& event) void AccountPanel::OnOperationModified(wxGridEvent& event)
@ -1048,3 +1095,8 @@ void AccountPanel::OnCalendarChange(wxCalendarEvent& event)
{ {
UpdateStats(); UpdateStats();
} }
void AccountPanel::OnCheckMode(wxCommandEvent& event)
{
UpdateStats();
}

View File

@ -70,6 +70,7 @@ class AccountPanel: public wxScrolledWindow
wxGrid *_statsGrid, *_accountsGrid; wxGrid *_statsGrid, *_accountsGrid;
PiePlot* _pie; PiePlot* _pie;
double *_categoriesValues; double *_categoriesValues;
wxCheckBox *_checkCheckMode;
std::map<wxString, int> _categoriesIndexes; std::map<wxString, int> _categoriesIndexes;
std::vector<Operation>* _curOperations; std::vector<Operation>* _curOperations;
wxString* _categories, *_accounts; wxString* _categories, *_accounts;
@ -82,6 +83,7 @@ class AccountPanel: public wxScrolledWindow
void UpdateStats(); void UpdateStats();
void InsertOperation(User* user, Operation* op, int line, bool fix); void InsertOperation(User* user, Operation* op, int line, bool fix);
void GetTreeSelection(int* month, int* year); void GetTreeSelection(int* month, int* year);
void OnCheckMode(wxCommandEvent& event);
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
}; };

View File

@ -149,6 +149,7 @@ void wxUI::ChangeUser()
void wxUI::LoadUser() void wxUI::LoadUser()
{ {
User* user = _kiss->GetUser(); User* user = _kiss->GetUser();
wxShowEvent event;
if (_curPanel) if (_curPanel)
{ {
@ -177,6 +178,7 @@ void wxUI::LoadUser()
_preferencesPanel = new PreferencesPanel(_kiss, this); _preferencesPanel = new PreferencesPanel(_kiss, this);
ShowPanel(_accountPanel); ShowPanel(_accountPanel);
_accountPanel->OnShow(event);
} }
void wxUI::ShowPanel(wxPanel* panel) void wxUI::ShowPanel(wxPanel* panel)