First pass for imports (with OFX imports)
This commit is contained in:
@@ -174,14 +174,6 @@ wxString KissCount::AddAccount(Account& ac)
|
||||
return ac.id;
|
||||
}
|
||||
|
||||
bool sortAccounts(Account ac1, Account ac2)
|
||||
{
|
||||
if (ac1._default) return true;
|
||||
if (ac2._default) return false;
|
||||
|
||||
return (ac1.name.Cmp(ac2.name) < 0);
|
||||
}
|
||||
|
||||
void KissCount::UpdateAccount(Account& ac)
|
||||
{
|
||||
std::vector<Account>::iterator it;
|
||||
@@ -427,6 +419,11 @@ void KissCount::SetOperationOrder(const wxString& order)
|
||||
_db->UpdatePreference(_user, wxT("operation_order"));
|
||||
}
|
||||
|
||||
const wxString& KissCount::GetOperationOrder()
|
||||
{
|
||||
return _user->_preferences[wxT("operation_order")] ;
|
||||
}
|
||||
|
||||
std::vector<Operation>* KissCount::Search(wxString* description, wxDateTime* dateFrom, wxDateTime* dateTo,
|
||||
wxString* amountFrom, wxString* amountTo,
|
||||
std::vector<wxString> categories, int types, std::vector<wxString> accounts)
|
||||
@@ -435,7 +432,7 @@ std::vector<Operation>* KissCount::Search(wxString* description, wxDateTime* dat
|
||||
return _db->Search(_user, description, dateFrom, dateTo, amountFrom, amountTo, categories, types, accounts, true);
|
||||
}
|
||||
|
||||
bool KissCount::SearchPreviousOperation(Operation* res, Operation& op, int month, int year)
|
||||
bool KissCount::SearchPreviousOperation(Operation* res, Operation& op, int month, int year, bool limitToType)
|
||||
{
|
||||
std::vector<Operation>* operations;
|
||||
wxDateTime* date ;
|
||||
@@ -452,7 +449,11 @@ bool KissCount::SearchPreviousOperation(Operation* res, Operation& op, int month
|
||||
|
||||
date = new wxDateTime(0, (wxDateTime::Month)month, year);
|
||||
|
||||
operations = _db->Search(_user, &op.description, date, NULL, NULL, NULL, v, op.fix_cost ? FIX_OP : NON_FIX_OP, v, false);
|
||||
if (limitToType)
|
||||
operations = _db->Search(_user, &op.description, date, NULL, NULL, NULL, v, op.fix_cost ? FIX_OP : NON_FIX_OP, v, false);
|
||||
else
|
||||
operations = _db->Search(_user, &op.description, date, NULL, NULL, NULL, v, ALL_OP, v, false);
|
||||
|
||||
|
||||
delete date;
|
||||
|
||||
@@ -601,7 +602,7 @@ ImportEngine* KissCount::GetImportEngine(wxString path)
|
||||
std::vector<ImportEngine*>::iterator it;
|
||||
|
||||
for(it=_importEngines.begin(); it!=_importEngines.end(); it++)
|
||||
if ((*it)->HandleFile(path, _user, _db))
|
||||
if ((*it)->HandleFile(path, _user, _db, this))
|
||||
return *it;
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -83,12 +83,13 @@ public:
|
||||
|
||||
void SetLanguage(wxLanguage language);
|
||||
void SetOperationOrder(const wxString& order);
|
||||
const wxString& GetOperationOrder();
|
||||
|
||||
std::vector<Operation>* Search(wxString* description, wxDateTime* dateFrom, wxDateTime* dateTo,
|
||||
wxString* amountFrom, wxString* amountTo,
|
||||
std::vector<wxString> categories, int types, std::vector<wxString> accounts);
|
||||
|
||||
bool SearchPreviousOperation(Operation* res, Operation& op, int month, int year);
|
||||
bool SearchPreviousOperation(Operation* res, Operation& op, int month, int year, bool limitToType);
|
||||
|
||||
void GetStats(int monthFrom, int yearFrom, int monthTo, int yearTo,
|
||||
std::map<wxString, std::map<int, std::map<int, double> > >* accountAmounts,
|
||||
|
||||
Reference in New Issue
Block a user