Add XMLImportEngine
Fix some bugs in ImportPanel and ImportEngines
This commit is contained in:
@@ -104,23 +104,27 @@ double KissCount::CalcAccountAmount(const wxString& id, int month, int year, boo
|
||||
return _db->CalcAccountAmount(id, month, year, had_values);
|
||||
}
|
||||
|
||||
void KissCount::UpdateOperation(Operation& op)
|
||||
void KissCount::UpdateOperation(Operation& op, bool checkTransfert)
|
||||
{
|
||||
// Unlink
|
||||
op.transfert = wxT("");
|
||||
_user->LinkOrUnlinkOperation(op);
|
||||
if (checkTransfert)
|
||||
{
|
||||
op.transfert = wxT("");
|
||||
_user->LinkOrUnlinkOperation(op);
|
||||
}
|
||||
|
||||
_db->UpdateOperation(_user, op);
|
||||
_db->UpdateOperation(_user, op, checkTransfert);
|
||||
|
||||
// Link
|
||||
_user->LinkOrUnlinkOperation(op);
|
||||
if (checkTransfert)
|
||||
_user->LinkOrUnlinkOperation(op);
|
||||
}
|
||||
|
||||
wxString KissCount::AddOperation(Operation& op)
|
||||
wxString KissCount::AddOperation(Operation& op, bool checkTransfert)
|
||||
{
|
||||
wxString ret = _db->AddOperation(_user, op);
|
||||
wxString ret = _db->AddOperation(_user, op, checkTransfert);
|
||||
|
||||
if (op.transfert.Length())
|
||||
if (checkTransfert && op.transfert.Length())
|
||||
_user->LinkOrUnlinkOperation(op);
|
||||
|
||||
return ret;
|
||||
@@ -159,9 +163,9 @@ double KissCount::MetaPositiveAmount(const wxString& id)
|
||||
return _db->MetaPositiveAmount(id);
|
||||
}
|
||||
|
||||
void KissCount::SetAccountAmount(int month, int year, const wxString& accountId, double amount)
|
||||
void KissCount::SetAccountAmount(const wxString& accountId, int month, int year, double amount)
|
||||
{
|
||||
_db->SetAccountAmount(month, year, accountId, amount);
|
||||
_db->SetAccountAmount(accountId, month, year, amount);
|
||||
}
|
||||
|
||||
wxString KissCount::AddAccount(Account& ac)
|
||||
@@ -173,7 +177,7 @@ wxString KissCount::AddAccount(Account& ac)
|
||||
|
||||
curDate.SetToCurrent();
|
||||
|
||||
SetAccountAmount((int)curDate.GetMonth(), curDate.GetYear(), ac.id, 0.0);
|
||||
SetAccountAmount(ac.id, (int)curDate.GetMonth(), curDate.GetYear(), 0.0);
|
||||
|
||||
return ac.id;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
s.Replace(wxT("\'"), wxT("\\\'"), true); \
|
||||
}
|
||||
|
||||
#define UNESCAPE_CHARS(s) { \
|
||||
s.Replace(wxT("\\\""), wxT("\""), true); \
|
||||
s.Replace(wxT("\\\'"), wxT("\'"), true); \
|
||||
}
|
||||
class wxUI;
|
||||
class Database;
|
||||
class ImportEngine;
|
||||
@@ -62,15 +66,15 @@ public:
|
||||
|
||||
void LoadYear(int year, bool force=false);
|
||||
|
||||
wxString AddOperation(Operation& op);
|
||||
void UpdateOperation(Operation& op);
|
||||
wxString AddOperation(Operation& op, bool checkTransfert=true);
|
||||
void UpdateOperation(Operation& op, bool checkTransfert=true);
|
||||
void DeleteOperation(Operation& op);
|
||||
void DeleteOperations(int month, int year);
|
||||
double MetaAmount(const wxString& id);
|
||||
double MetaPositiveAmount(const wxString& id);
|
||||
|
||||
double GetAccountAmount(const wxString& id, int month, int year);
|
||||
void SetAccountAmount(int month, int year, const wxString& accountId, double value);
|
||||
void SetAccountAmount(const wxString& accountId, int month, int year, double value);
|
||||
double CalcAccountAmount(const wxString& id, int month, int year, bool* had_values);
|
||||
|
||||
wxString AddAccount(Account& ac);
|
||||
|
||||
Reference in New Issue
Block a user