Add ImportPanel
Throw exception when category/account are not found in User Fix a bug in GrisbiImportEngine with QDate::fromString Try to search an account also with its name Remove categories number limit (only used for pie color)
This commit is contained in:
@@ -110,10 +110,10 @@ void GrisbiImportEngine::LoadOperation(const QXmlAttributes& attrs)
|
||||
|
||||
op.account = _accounts[attrs.value("Ac").toInt()];
|
||||
|
||||
date.fromString(attrs.value("Dt"), "MM/%dd/%yyyy");
|
||||
date = QDate::fromString(attrs.value("Dt"), "MM/dd/yyyy");
|
||||
op.day = date.day();
|
||||
op.month = date.month();
|
||||
op.year = date.year();
|
||||
op.year = date.year();
|
||||
op.amount = attrs.value("Am").toDouble();
|
||||
op.category = _categories[attrs.value("Ca").toInt()];
|
||||
op.description = attrs.value("No");
|
||||
|
||||
@@ -93,7 +93,6 @@ bool XMLImportEngine::startElement (const QString& namespaceURI, const QString&
|
||||
void XMLImportEngine::LoadAccount(const QXmlAttributes& attrs)
|
||||
{
|
||||
int id;
|
||||
QString account_number, name;
|
||||
Account ac;
|
||||
static int unknownAccount = 0;
|
||||
|
||||
@@ -101,7 +100,7 @@ void XMLImportEngine::LoadAccount(const QXmlAttributes& attrs)
|
||||
|
||||
ac.name = attrs.value("name");
|
||||
ac.id = id = attrs.value("id").toInt();
|
||||
ac.number = account_number = attrs.value("number");
|
||||
ac.number = attrs.value("number");
|
||||
ac.blocked = (attrs.value("blocked") == "1");
|
||||
ac._virtual = (attrs.value("virtual") == "1");
|
||||
ac.hidden = (attrs.value("hidden") == "1");
|
||||
@@ -113,10 +112,21 @@ void XMLImportEngine::LoadAccount(const QXmlAttributes& attrs)
|
||||
ac.shared = false;
|
||||
ac.is_owner = true;
|
||||
|
||||
if (account_number.size())
|
||||
if (ac.number.size())
|
||||
{
|
||||
try {
|
||||
_accounts[ac.id] = _user->GetAccountIdFromAccountNumber(account_number);
|
||||
_accounts[ac.id] = _user->GetAccountIdFromAccountNumber(ac.number);
|
||||
return;
|
||||
}
|
||||
catch (User::AccountNotFound)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (ac.name.size())
|
||||
{
|
||||
try {
|
||||
_accounts[ac.id] = _user->GetAccountId(ac.name);
|
||||
return;
|
||||
}
|
||||
catch (User::AccountNotFound)
|
||||
|
||||
Reference in New Issue
Block a user