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:
@@ -80,7 +80,7 @@ QString User::GetCategoryName(int catId)
|
||||
return _("Unknown") ;
|
||||
}
|
||||
|
||||
int User::GetCategoryId(const QString& catName)
|
||||
int User::GetCategoryId(const QString& catName) throw (CategoryNotFound)
|
||||
{
|
||||
std::vector<Category>::iterator it;
|
||||
Category cat;
|
||||
@@ -92,7 +92,7 @@ int User::GetCategoryId(const QString& catName)
|
||||
if ( _db->LoadCategory(0, catName, cat))
|
||||
return cat.id;
|
||||
|
||||
return 0 ;
|
||||
throw CategoryNotFound();
|
||||
}
|
||||
|
||||
const QFont User::GetCategoryFont(int catId)
|
||||
@@ -158,24 +158,24 @@ QString User::GetAccountName(int accountId)
|
||||
return _("Unknown") ;
|
||||
}
|
||||
|
||||
int User::GetAccountId(const QString& accountName)
|
||||
int User::GetAccountId(const QString& accountName) throw (AccountNotFound)
|
||||
{
|
||||
std::vector<Account>::iterator it;
|
||||
for (it=_accounts.begin(); it !=_accounts.end(); it++)
|
||||
if (it->name == accountName)
|
||||
return it->id;
|
||||
|
||||
return 0 ;
|
||||
throw AccountNotFound();
|
||||
}
|
||||
|
||||
int User::GetAccountIdFromAccountNumber(const QString& accountNumber)
|
||||
int User::GetAccountIdFromAccountNumber(const QString& accountNumber) throw (AccountNotFound)
|
||||
{
|
||||
std::vector<Account>::iterator it;
|
||||
for (it=_accounts.begin(); it !=_accounts.end(); it++)
|
||||
if (it->number == accountNumber)
|
||||
return it->id;
|
||||
|
||||
return 0 ;
|
||||
throw AccountNotFound();
|
||||
}
|
||||
|
||||
void User::AddAccount(Account& ac)
|
||||
|
||||
Reference in New Issue
Block a user