|
|
@ -99,7 +99,7 @@ void MyMoneyTransactionFilter::addAccount(const TQStringList& ids)
|
|
|
|
void MyMoneyTransactionFilter::addAccount(const TQString& id)
|
|
|
|
void MyMoneyTransactionFilter::addAccount(const TQString& id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!m_accounts.isEmpty() && !id.isEmpty()) {
|
|
|
|
if(!m_accounts.isEmpty() && !id.isEmpty()) {
|
|
|
|
if(m_accounts.find(id) != 0)
|
|
|
|
if(m_accounts.find(id.utf8()) != 0)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_accounts.count() >= m_accounts.size()*2) {
|
|
|
|
if(m_accounts.count() >= m_accounts.size()*2) {
|
|
|
@ -107,7 +107,7 @@ void MyMoneyTransactionFilter::addAccount(const TQString& id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_filterSet.singleFilter.accountFilter = 1;
|
|
|
|
m_filterSet.singleFilter.accountFilter = 1;
|
|
|
|
if(!id.isEmpty())
|
|
|
|
if(!id.isEmpty())
|
|
|
|
m_accounts.insert(id, "");
|
|
|
|
m_accounts.insert(id.utf8(), "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MyMoneyTransactionFilter::addCategory(const TQStringList& ids)
|
|
|
|
void MyMoneyTransactionFilter::addCategory(const TQStringList& ids)
|
|
|
@ -122,7 +122,7 @@ void MyMoneyTransactionFilter::addCategory(const TQStringList& ids)
|
|
|
|
void MyMoneyTransactionFilter::addCategory(const TQString& id)
|
|
|
|
void MyMoneyTransactionFilter::addCategory(const TQString& id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!m_categories.isEmpty() && !id.isEmpty()) {
|
|
|
|
if(!m_categories.isEmpty() && !id.isEmpty()) {
|
|
|
|
if(m_categories.find(id) != 0)
|
|
|
|
if(m_categories.find(id.utf8()) != 0)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_categories.count() >= m_categories.size()*2) {
|
|
|
|
if(m_categories.count() >= m_categories.size()*2) {
|
|
|
@ -130,7 +130,7 @@ void MyMoneyTransactionFilter::addCategory(const TQString& id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_filterSet.singleFilter.categoryFilter = 1;
|
|
|
|
m_filterSet.singleFilter.categoryFilter = 1;
|
|
|
|
if(!id.isEmpty())
|
|
|
|
if(!id.isEmpty())
|
|
|
|
m_categories.insert(id, "");
|
|
|
|
m_categories.insert(id.utf8(), "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MyMoneyTransactionFilter::setDateFilter(const TQDate& from, const TQDate& to)
|
|
|
|
void MyMoneyTransactionFilter::setDateFilter(const TQDate& from, const TQDate& to)
|
|
|
@ -157,7 +157,7 @@ void MyMoneyTransactionFilter::setAmountFilter(const MyMoneyMoney& from, const M
|
|
|
|
void MyMoneyTransactionFilter::addPayee(const TQString& id)
|
|
|
|
void MyMoneyTransactionFilter::addPayee(const TQString& id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!m_payees.isEmpty() && !id.isEmpty()) {
|
|
|
|
if(!m_payees.isEmpty() && !id.isEmpty()) {
|
|
|
|
if(m_payees.find(id) != 0)
|
|
|
|
if(m_payees.find(id.utf8()) != 0)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_payees.count() >= m_payees.size()*2) {
|
|
|
|
if(m_payees.count() >= m_payees.size()*2) {
|
|
|
@ -165,7 +165,7 @@ void MyMoneyTransactionFilter::addPayee(const TQString& id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_filterSet.singleFilter.payeeFilter = 1;
|
|
|
|
m_filterSet.singleFilter.payeeFilter = 1;
|
|
|
|
if(!id.isEmpty())
|
|
|
|
if(!id.isEmpty())
|
|
|
|
m_payees.insert(id, "");
|
|
|
|
m_payees.insert(id.utf8(), "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MyMoneyTransactionFilter::addType(const int type)
|
|
|
|
void MyMoneyTransactionFilter::addType(const int type)
|
|
|
@ -336,7 +336,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
|
|
|
|
// check if the split references one of the categories in the list
|
|
|
|
// check if the split references one of the categories in the list
|
|
|
|
if(m_filterSet.singleFilter.categoryFilter) {
|
|
|
|
if(m_filterSet.singleFilter.categoryFilter) {
|
|
|
|
if(m_categories.count() > 0) {
|
|
|
|
if(m_categories.count() > 0) {
|
|
|
|
if(m_categories.find(sp->accountId())) {
|
|
|
|
if(m_categories.find(sp->accountId().utf8())) {
|
|
|
|
categoryMatched = true;
|
|
|
|
categoryMatched = true;
|
|
|
|
removeSplit = 0;
|
|
|
|
removeSplit = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -351,7 +351,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
|
|
|
|
// check if the split references one of the accounts in the list
|
|
|
|
// check if the split references one of the accounts in the list
|
|
|
|
if(m_filterSet.singleFilter.accountFilter) {
|
|
|
|
if(m_filterSet.singleFilter.accountFilter) {
|
|
|
|
if(m_accounts.count() > 0) {
|
|
|
|
if(m_accounts.count() > 0) {
|
|
|
|
if(m_accounts.find(sp->accountId())) {
|
|
|
|
if(m_accounts.find(sp->accountId().utf8())) {
|
|
|
|
accountMatched = true;
|
|
|
|
accountMatched = true;
|
|
|
|
removeSplit = 0;
|
|
|
|
removeSplit = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -365,7 +365,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if(m_filterSet.singleFilter.accountFilter) {
|
|
|
|
if(m_filterSet.singleFilter.accountFilter) {
|
|
|
|
if(m_accounts.count() > 0) {
|
|
|
|
if(m_accounts.count() > 0) {
|
|
|
|
if(m_accounts.find(sp->accountId())) {
|
|
|
|
if(m_accounts.find(sp->accountId().utf8())) {
|
|
|
|
accountMatched = true;
|
|
|
|
accountMatched = true;
|
|
|
|
removeSplit = 0;
|
|
|
|
removeSplit = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -424,7 +424,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
|
|
|
|
// check the payee list
|
|
|
|
// check the payee list
|
|
|
|
if(!removeSplit && m_filterSet.singleFilter.payeeFilter) {
|
|
|
|
if(!removeSplit && m_filterSet.singleFilter.payeeFilter) {
|
|
|
|
if(m_payees.count() > 0) {
|
|
|
|
if(m_payees.count() > 0) {
|
|
|
|
if(sp->payeeId().isEmpty() || !m_payees.find(sp->payeeId()))
|
|
|
|
if(sp->payeeId().isEmpty() || !m_payees.find(sp->payeeId().utf8()))
|
|
|
|
removeSplit = sp;
|
|
|
|
removeSplit = sp;
|
|
|
|
} else if(!sp->payeeId().isEmpty())
|
|
|
|
} else if(!sp->payeeId().isEmpty())
|
|
|
|
removeSplit = sp;
|
|
|
|
removeSplit = sp;
|
|
|
@ -548,17 +548,17 @@ MyMoneyTransactionFilter::validityOptionE MyMoneyTransactionFilter::validTransac
|
|
|
|
|
|
|
|
|
|
|
|
bool MyMoneyTransactionFilter::includesCategory( const TQString& cat ) const
|
|
|
|
bool MyMoneyTransactionFilter::includesCategory( const TQString& cat ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return (! m_filterSet.singleFilter.categoryFilter) || m_categories.find( cat );
|
|
|
|
return (! m_filterSet.singleFilter.categoryFilter) || m_categories.find( cat.utf8() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MyMoneyTransactionFilter::includesAccount( const TQString& acc ) const
|
|
|
|
bool MyMoneyTransactionFilter::includesAccount( const TQString& acc ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return (! m_filterSet.singleFilter.accountFilter) || m_accounts.find( acc );
|
|
|
|
return (! m_filterSet.singleFilter.accountFilter) || m_accounts.find( acc.utf8() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MyMoneyTransactionFilter::includesPayee( const TQString& pye ) const
|
|
|
|
bool MyMoneyTransactionFilter::includesPayee( const TQString& pye ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return (! m_filterSet.singleFilter.payeeFilter) || m_payees.find( pye );
|
|
|
|
return (! m_filterSet.singleFilter.payeeFilter) || m_payees.find( pye.utf8() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MyMoneyTransactionFilter::dateFilter( TQDate& from, TQDate& to ) const
|
|
|
|
bool MyMoneyTransactionFilter::dateFilter( TQDate& from, TQDate& to ) const
|
|
|
@ -848,14 +848,14 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start,
|
|
|
|
|
|
|
|
|
|
|
|
void MyMoneyTransactionFilter::removeReference(const TQString& id)
|
|
|
|
void MyMoneyTransactionFilter::removeReference(const TQString& id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(m_accounts.find(id)) {
|
|
|
|
if(m_accounts.find(id.utf8())) {
|
|
|
|
tqDebug(TQString("Remove account '%1' from report").arg(id));
|
|
|
|
tqDebug(TQString("Remove account '%1' from report").arg(id));
|
|
|
|
m_accounts.remove(id);
|
|
|
|
m_accounts.remove(id.utf8());
|
|
|
|
} else if(m_categories.find(id)) {
|
|
|
|
} else if(m_categories.find(id.utf8())) {
|
|
|
|
tqDebug(TQString("Remove category '%1' from report").arg(id));
|
|
|
|
tqDebug(TQString("Remove category '%1' from report").arg(id));
|
|
|
|
m_categories.remove(id);
|
|
|
|
m_categories.remove(id.utf8());
|
|
|
|
} else if(m_payees.find(id)) {
|
|
|
|
} else if(m_payees.find(id.utf8())) {
|
|
|
|
tqDebug(TQString("Remove payee '%1' from report").arg(id));
|
|
|
|
tqDebug(TQString("Remove payee '%1' from report").arg(id));
|
|
|
|
m_payees.remove(id);
|
|
|
|
m_payees.remove(id.utf8());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|