diff options
Diffstat (limited to 'kmymoney2/mymoney')
22 files changed, 330 insertions, 330 deletions
diff --git a/kmymoney2/mymoney/mymoneyaccount.h b/kmymoney2/mymoney/mymoneyaccount.h index 968cadb..8ab368c 100644 --- a/kmymoney2/mymoney/mymoneyaccount.h +++ b/kmymoney2/mymoney/mymoneyaccount.h @@ -342,7 +342,7 @@ public: /** * This method is used to update m_lastModified to the current date */ - void touch(void) { setLastModified(TQDate::tqcurrentDate()); } + void touch(void) { setLastModified(TQDate::currentDate()); } /** * This method returns the type of the account. diff --git a/kmymoney2/mymoney/mymoneyaccounttest.cpp b/kmymoney2/mymoney/mymoneyaccounttest.cpp index a7c55af..b30b0ce 100644 --- a/kmymoney2/mymoney/mymoneyaccounttest.cpp +++ b/kmymoney2/mymoney/mymoneyaccounttest.cpp @@ -49,8 +49,8 @@ void MyMoneyAccountTest::testConstructor() { MyMoneyAccount r; MyMoneySplit s; r.setAccountType(MyMoneyAccount::Asset); - r.setOpeningDate(TQDate::tqcurrentDate()); - r.setLastModified(TQDate::tqcurrentDate()); + r.setOpeningDate(TQDate::currentDate()); + r.setLastModified(TQDate::currentDate()); r.setDescription("Desc"); r.setNumber("465500"); r.setParentAccountId(parent); @@ -65,8 +65,8 @@ void MyMoneyAccountTest::testConstructor() { CPPUNIT_ASSERT(a.id() == id); CPPUNIT_ASSERT(a.institutionId().isEmpty()); CPPUNIT_ASSERT(a.accountType() == MyMoneyAccount::Asset); - CPPUNIT_ASSERT(a.openingDate() == TQDate::tqcurrentDate()); - CPPUNIT_ASSERT(a.lastModified() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.openingDate() == TQDate::currentDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate::currentDate()); CPPUNIT_ASSERT(a.number() == "465500"); CPPUNIT_ASSERT(a.description() == "Desc"); CPPUNIT_ASSERT(a.accountList().count() == 0); @@ -82,7 +82,7 @@ void MyMoneyAccountTest::testConstructor() { void MyMoneyAccountTest::testSetFunctions() { MyMoneyAccount a; - TQDate today(TQDate::tqcurrentDate()); + TQDate today(TQDate::currentDate()); CPPUNIT_ASSERT(a.name().isEmpty()); CPPUNIT_ASSERT(a.lastModified() == TQDate()); CPPUNIT_ASSERT(a.description().isEmpty()); @@ -108,8 +108,8 @@ void MyMoneyAccountTest::testCopyConstructor() { TQString parent = "ParentAccount"; MyMoneyAccount r; r.setAccountType(MyMoneyAccount::Expense); - r.setOpeningDate(TQDate::tqcurrentDate()); - r.setLastModified(TQDate::tqcurrentDate()); + r.setOpeningDate(TQDate::currentDate()); + r.setLastModified(TQDate::currentDate()); r.setName("Account"); r.setInstitutionId("Inst1"); r.setDescription("Desc1"); @@ -125,8 +125,8 @@ void MyMoneyAccountTest::testCopyConstructor() { CPPUNIT_ASSERT(b.name() == "Account"); CPPUNIT_ASSERT(b.institutionId() == institutionid); CPPUNIT_ASSERT(b.accountType() == MyMoneyAccount::Expense); - CPPUNIT_ASSERT(b.lastModified() == TQDate::tqcurrentDate()); - CPPUNIT_ASSERT(b.openingDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate::currentDate()); + CPPUNIT_ASSERT(b.openingDate() == TQDate::currentDate()); CPPUNIT_ASSERT(b.description() == "Desc1"); CPPUNIT_ASSERT(b.number() == "Number"); CPPUNIT_ASSERT(b.parentAccountId() == "ParentAccount"); @@ -146,7 +146,7 @@ void MyMoneyAccountTest::testAssignmentConstructor() { MyMoneyAccount b; - b.setLastModified(TQDate::tqcurrentDate()); + b.setLastModified(TQDate::currentDate()); b = a; @@ -199,13 +199,13 @@ void MyMoneyAccountTest::testEquality() { MyMoneyAccount a; - a.setLastModified(TQDate::tqcurrentDate()); + a.setLastModified(TQDate::currentDate()); a.setName("Name"); a.setNumber("Number"); a.setDescription("Desc"); a.setInstitutionId("I-ID"); - a.setOpeningDate(TQDate::tqcurrentDate()); - a.setLastReconciliationDate(TQDate::tqcurrentDate()); + a.setOpeningDate(TQDate::currentDate()); + a.setLastReconciliationDate(TQDate::currentDate()); a.setAccountType(MyMoneyAccount::Asset); a.setParentAccountId("P-ID"); a.setId("A-ID"); @@ -221,7 +221,7 @@ void MyMoneyAccountTest::testEquality() CPPUNIT_ASSERT(!(b == a)); b = a; - a.setLastModified(TQDate::tqcurrentDate().addDays(-1)); + a.setLastModified(TQDate::currentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; @@ -237,11 +237,11 @@ void MyMoneyAccountTest::testEquality() CPPUNIT_ASSERT(!(b == a)); b = a; - a.setOpeningDate(TQDate::tqcurrentDate().addDays(-1)); + a.setOpeningDate(TQDate::currentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; - a.setLastReconciliationDate(TQDate::tqcurrentDate().addDays(-1)); + a.setLastReconciliationDate(TQDate::currentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; @@ -278,8 +278,8 @@ void MyMoneyAccountTest::testWriteXML() { MyMoneyAccount r; r.setAccountType(MyMoneyAccount::Asset); - r.setOpeningDate(TQDate::tqcurrentDate()); - r.setLastModified(TQDate::tqcurrentDate()); + r.setOpeningDate(TQDate::currentDate()); + r.setLastModified(TQDate::currentDate()); r.setDescription("Desc"); r.setName("AccountName"); r.setNumber("465500"); @@ -309,7 +309,7 @@ void MyMoneyAccountTest::testWriteXML() { " </KEYVALUEPAIRS>\n" " </ACCOUNT>\n" "</ACCOUNT-CONTAINER>\n"). - arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); + arg(TQDate::currentDate().toString(Qt::ISODate)).tqarg(TQDate::currentDate().toString(Qt::ISODate)); CPPUNIT_ASSERT(doc.toString() == ref); } @@ -330,7 +330,7 @@ void MyMoneyAccountTest::testReadXML() { " </KEYVALUEPAIRS>\n" " </ACCOUNT>\n" "</ACCOUNT-CONTAINER>\n"). - arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); + arg(TQDate::currentDate().toString(Qt::ISODate)).tqarg(TQDate::currentDate().toString(Qt::ISODate)); TQString ref_false = TQString( "<!DOCTYPE TEST>\n" @@ -346,7 +346,7 @@ void MyMoneyAccountTest::testReadXML() { " </KEYVALUEPAIRS>\n" " </KACCOUNT>\n" "</ACCOUNT-CONTAINER>\n"). - arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); + arg(TQDate::currentDate().toString(Qt::ISODate)).tqarg(TQDate::currentDate().toString(Qt::ISODate)); TQDomDocument doc; TQDomElement node; @@ -371,11 +371,11 @@ void MyMoneyAccountTest::testReadXML() { CPPUNIT_ASSERT(a.id() == "A000001"); CPPUNIT_ASSERT(a.m_name == "AccountName"); CPPUNIT_ASSERT(a.m_parentAccount == "Parent"); - CPPUNIT_ASSERT(a.m_lastModified == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.m_lastModified == TQDate::currentDate()); CPPUNIT_ASSERT(a.m_lastReconciliationDate == TQDate()); CPPUNIT_ASSERT(a.m_institution == "B000001"); CPPUNIT_ASSERT(a.m_number == "465500"); - CPPUNIT_ASSERT(a.m_openingDate == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.m_openingDate == TQDate::currentDate()); CPPUNIT_ASSERT(a.m_accountType == MyMoneyAccount::Asset); CPPUNIT_ASSERT(a.m_description == "Desc"); CPPUNIT_ASSERT(a.accountList().count() == 2); diff --git a/kmymoney2/mymoney/mymoneyfile.cpp b/kmymoney2/mymoney/mymoneyfile.cpp index c36c163..84146bd 100644 --- a/kmymoney2/mymoney/mymoneyfile.cpp +++ b/kmymoney2/mymoney/mymoneyfile.cpp @@ -619,7 +619,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) if(!account.openingDate().isValid()) { - account.setOpeningDate(TQDate::tqcurrentDate()); + account.setOpeningDate(TQDate::currentDate()); } account.setParentAccountId(parent.id()); diff --git a/kmymoney2/mymoney/mymoneyfile.h b/kmymoney2/mymoney/mymoneyfile.h index 410115d..ceb67ad 100644 --- a/kmymoney2/mymoney/mymoneyfile.h +++ b/kmymoney2/mymoney/mymoneyfile.h @@ -1145,7 +1145,7 @@ public: * @return price found as MyMoneyPrice object * @note This throws an exception when the base currency is not set and toId is empty */ - const MyMoneyPrice price(const TQString& fromId, const TQString& toId = TQString(), const TQDate& date = TQDate::tqcurrentDate(), const bool exactDate = false) const; + const MyMoneyPrice price(const TQString& fromId, const TQString& toId = TQString(), const TQDate& date = TQDate::currentDate(), const bool exactDate = false) const; /** * This method returns a list of all prices. diff --git a/kmymoney2/mymoney/mymoneyfiletest.cpp b/kmymoney2/mymoney/mymoneyfiletest.cpp index 431debb..8fdbea4 100644 --- a/kmymoney2/mymoney/mymoneyfiletest.cpp +++ b/kmymoney2/mymoney/mymoneyfiletest.cpp @@ -761,16 +761,16 @@ void MyMoneyFileTest::testAddTransaction () { CPPUNIT_ASSERT(t.id() == "T000000000000000001"); CPPUNIT_ASSERT(t.postDate() == TQDate(2002,2,1)); - CPPUNIT_ASSERT(t.entryDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(t.entryDate() == TQDate::currentDate()); CPPUNIT_ASSERT(m->dirty() == true); // check the balance of the accounts a = m->account("A000001"); - CPPUNIT_ASSERT(a.lastModified() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate::currentDate()); CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(-1000)); MyMoneyAccount b = m->account("A000003"); - CPPUNIT_ASSERT(b.lastModified() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate::currentDate()); CPPUNIT_ASSERT(b.balance() == MyMoneyMoney(1000)); storage->m_dirty = false; @@ -1490,7 +1490,7 @@ void MyMoneyFileTest::testOpeningBalance(void) openingAcc = m->openingBalanceAccount(m->baseCurrency()); CPPUNIT_ASSERT(openingAcc.parentAccountId() == m->equity().id()); CPPUNIT_ASSERT(openingAcc.name() == MyMoneyFile::OpeningBalancesPrefix); - CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::currentDate()); } catch(MyMoneyException *e) { unexpectedException(e); } @@ -1509,7 +1509,7 @@ void MyMoneyFileTest::testOpeningBalance(void) openingAcc = m->openingBalanceAccount(second); CPPUNIT_ASSERT(openingAcc.parentAccountId() == m->equity().id()); CPPUNIT_ASSERT(openingAcc.name() == refName); - CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::currentDate()); } catch(MyMoneyException *e) { unexpectedException(e); } diff --git a/kmymoney2/mymoney/mymoneyforecast.cpp b/kmymoney2/mymoney/mymoneyforecast.cpp index 4365b47..bfecce0 100644 --- a/kmymoney2/mymoney/mymoneyforecast.cpp +++ b/kmymoney2/mymoney/mymoneyforecast.cpp @@ -47,8 +47,8 @@ MyMoneyForecast::MyMoneyForecast() : { setForecastCycles(KMyMoneyGlobalSettings::forecastCycles()); setAccountsCycle(KMyMoneyGlobalSettings::forecastAccountCycle()); - setHistoryStartDate(TQDate::tqcurrentDate().addDays(-forecastCycles()*accountsCycle())); - setHistoryEndDate(TQDate::tqcurrentDate().addDays(-1)); + setHistoryStartDate(TQDate::currentDate().addDays(-forecastCycles()*accountsCycle())); + setHistoryEndDate(TQDate::currentDate().addDays(-1)); setForecastDays(KMyMoneyGlobalSettings::forecastDays()); setBeginForecastDay(KMyMoneyGlobalSettings::beginForecastDay()); setForecastMethod(KMyMoneyGlobalSettings::forecastMethod()); @@ -75,12 +75,12 @@ void MyMoneyForecast::doForecast() //initialize global variables setForecastDays(fDays); - setForecastStartDate(TQDate::tqcurrentDate().addDays(1)); - setForecastEndDate(TQDate::tqcurrentDate().addDays(fDays)); + setForecastStartDate(TQDate::currentDate().addDays(1)); + setForecastEndDate(TQDate::currentDate().addDays(fDays)); setAccountsCycle(fAccCycle); setForecastCycles(fCycles); setHistoryStartDate(forecastCycles() * accountsCycle()); - setHistoryEndDate(TQDate::tqcurrentDate().addDays(-1)); //yesterday + setHistoryEndDate(TQDate::currentDate().addDays(-1)); //yesterday //clear all data before calculating m_accountListPast.clear(); @@ -343,14 +343,14 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i //If it is a new account, we don't take into account the first day //because it is usually a weird one and it would mess up the trend - if(openingDate.daysTo(TQDate::tqcurrentDate())<trendDays){ + if(openingDate.daysTo(TQDate::currentDate())<trendDays){ startDate = (acc.openingDate()).addDays(1); } else { - startDate = TQDate::tqcurrentDate().addDays(-trendDays); + startDate = TQDate::currentDate().addDays(-trendDays); } //get all transactions for the period - filter.setDateFilter(startDate, TQDate::tqcurrentDate()); + filter.setDateFilter(startDate, TQDate::currentDate()); if(acc.accountGroup() == MyMoneyAccount::Income || acc.accountGroup() == MyMoneyAccount::Expense) { filter.addCategory(acc.id()); @@ -377,8 +377,8 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i MyMoneyMoney accTrend; //don't take into account the first day of the account - if(openingDate.daysTo(TQDate::tqcurrentDate())<trendDays) { - accTrend = netIncome/MyMoneyMoney(openingDate.daysTo(TQDate::tqcurrentDate())-1,1); + if(openingDate.daysTo(TQDate::currentDate())<trendDays) { + accTrend = netIncome/MyMoneyMoney(openingDate.daysTo(TQDate::currentDate())-1,1); } else { accTrend = netIncome/MyMoneyMoney(trendDays,1); } @@ -490,7 +490,7 @@ void MyMoneyForecast::calculateHistoricDailyBalances() break; case 2: { - TQDate baseDate = TQDate::tqcurrentDate().addDays(-accountsCycle()); + TQDate baseDate = TQDate::currentDate().addDays(-accountsCycle()); for(int t_day = 1; t_day <= accountsCycle(); ++t_day) { int f_day = 1; TQDate fDate = baseDate.addDays(accountsCycle()+1); @@ -536,7 +536,7 @@ MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, TQDate */ MyMoneyMoney MyMoneyForecast::forecastBalance (const MyMoneyAccount& acc, int offset ) { - TQDate forecastDate = TQDate::tqcurrentDate().addDays(offset); + TQDate forecastDate = TQDate::currentDate().addDays(offset); return forecastBalance(acc, forecastDate); } @@ -570,7 +570,7 @@ void MyMoneyForecast::doFutureScheduledForecast(void) MyMoneyMoney rate = MyMoneyMoney ( 1, 1 ); MyMoneyPrice price; - for (TQDate it_day = TQDate::tqcurrentDate(); it_day <= forecastEndDate(); ) { + for (TQDate it_day = TQDate::currentDate(); it_day <= forecastEndDate(); ) { //get the price for the tradingCurrency that day price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), it_day ); if ( price.isValid() ) @@ -651,7 +651,7 @@ void MyMoneyForecast::addScheduledTransactions (void) TQValueList<MyMoneySchedule> schedule; schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - TQDate::tqcurrentDate(), forecastEndDate()); + TQDate::currentDate(), forecastEndDate()); if(schedule.count() > 0) { TQValueList<MyMoneySchedule>::Iterator it; do { @@ -698,12 +698,12 @@ void MyMoneyForecast::addScheduledTransactions (void) if(isForecastAccount(acc)) { // collect all overdues on the first day TQDate forecastDate = nextDate; - if(TQDate::tqcurrentDate() >= nextDate) - forecastDate = TQDate::tqcurrentDate().addDays(1); + if(TQDate::currentDate() >= nextDate) + forecastDate = TQDate::currentDate().addDays(1); dailyBalances balance; balance = m_accountList[acc.id()]; - for(TQDate f_day = TQDate::tqcurrentDate(); f_day < forecastDate; ) { + for(TQDate f_day = TQDate::currentDate(); f_day < forecastDate; ) { balanceMap[acc.id()] += m_accountList[acc.id()][f_day]; f_day = f_day.addDays(1); } @@ -719,14 +719,14 @@ void MyMoneyForecast::addScheduledTransactions (void) if(isForecastAccount(acc)) { dailyBalances balance; balance = m_accountList[acc.id()]; - //int offset = TQDate::tqcurrentDate().daysTo(nextDate); + //int offset = TQDate::currentDate().daysTo(nextDate); //if(offset <= 0) { // collect all overdues on the first day // offset = 1; //} // collect all overdues on the first day TQDate forecastDate = nextDate; - if(TQDate::tqcurrentDate() >= nextDate) - forecastDate = TQDate::tqcurrentDate().addDays(1); + if(TQDate::currentDate() >= nextDate) + forecastDate = TQDate::currentDate().addDays(1); if(acc.accountType() == MyMoneyAccount::Income) { balance[forecastDate] += ((*it_s).shares() * MyMoneyMoney(-1, 1)); @@ -807,9 +807,9 @@ int MyMoneyForecast::daysToMinimumBalance(const MyMoneyAccount& acc) balance = m_accountList[acc.id()]; - for(TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) { + for(TQDate it_day = TQDate::currentDate() ; it_day <= forecastEndDate(); ) { if(minBalance > balance[it_day]) { - return TQDate::tqcurrentDate().daysTo(it_day); + return TQDate::currentDate().daysTo(it_day); } it_day = it_day.addDays(1); } @@ -828,20 +828,20 @@ int MyMoneyForecast::daysToZeroBalance(const MyMoneyAccount& acc) balance = m_accountList[acc.id()]; if (acc.accountGroup() == MyMoneyAccount::Asset) { - for (TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) + for (TQDate it_day = TQDate::currentDate() ; it_day <= forecastEndDate(); ) { if ( balance[it_day] < MyMoneyMoney ( 0, 1 ) ) { - return TQDate::tqcurrentDate().daysTo(it_day); + return TQDate::currentDate().daysTo(it_day); } it_day = it_day.addDays(1); } } else if (acc.accountGroup() == MyMoneyAccount::Liability) { - for (TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) + for (TQDate it_day = TQDate::currentDate() ; it_day <= forecastEndDate(); ) { if ( balance[it_day] > MyMoneyMoney ( 0, 1 ) ) { - return TQDate::tqcurrentDate().daysTo(it_day); + return TQDate::currentDate().daysTo(it_day); } it_day = it_day.addDays(1); } @@ -882,7 +882,7 @@ MyMoneyMoney MyMoneyForecast::accountTotalVariation(const MyMoneyAccount& acc) { MyMoneyMoney totalVariation; - totalVariation = forecastBalance(acc, forecastEndDate()) - forecastBalance(acc, TQDate::tqcurrentDate()); + totalVariation = forecastBalance(acc, forecastEndDate()) - forecastBalance(acc, TQDate::currentDate()); return totalVariation; } @@ -891,15 +891,15 @@ TQValueList<TQDate> MyMoneyForecast::accountMinimumBalanceDateList(const MyMoney TQValueList<TQDate> minBalanceList; int daysToBeginDay; - daysToBeginDay = TQDate::tqcurrentDate().daysTo(beginForecastDate()); + daysToBeginDay = TQDate::currentDate().daysTo(beginForecastDate()); for(int t_cycle = 0; ((t_cycle * accountsCycle()) + daysToBeginDay) < forecastDays() ; ++t_cycle) { MyMoneyMoney minBalance = forecastBalance(acc, (t_cycle * accountsCycle() + daysToBeginDay)); - TQDate minDate = TQDate::tqcurrentDate().addDays(t_cycle * accountsCycle() + daysToBeginDay); + TQDate minDate = TQDate::currentDate().addDays(t_cycle * accountsCycle() + daysToBeginDay); for(int t_day = 1; t_day <= accountsCycle() ; ++t_day) { if( minBalance > forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day) ) { minBalance = forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day ); - minDate = TQDate::tqcurrentDate().addDays( (t_cycle * accountsCycle()) + daysToBeginDay + t_day); + minDate = TQDate::currentDate().addDays( (t_cycle * accountsCycle()) + daysToBeginDay + t_day); } } minBalanceList.append(minDate); @@ -912,16 +912,16 @@ TQValueList<TQDate> MyMoneyForecast::accountMaximumBalanceDateList(const MyMoney TQValueList<TQDate> maxBalanceList; int daysToBeginDay; - daysToBeginDay = TQDate::tqcurrentDate().daysTo(beginForecastDate()); + daysToBeginDay = TQDate::currentDate().daysTo(beginForecastDate()); for(int t_cycle = 0; ((t_cycle * accountsCycle()) + daysToBeginDay) < forecastDays() ; ++t_cycle) { MyMoneyMoney maxBalance = forecastBalance(acc, ((t_cycle * accountsCycle()) + daysToBeginDay)); - TQDate maxDate = TQDate::tqcurrentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay); + TQDate maxDate = TQDate::currentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay); for(int t_day = 0; t_day < accountsCycle() ; ++t_day) { if( maxBalance < forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day) ) { maxBalance = forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day ); - maxDate = TQDate::tqcurrentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay + t_day); + maxDate = TQDate::currentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay + t_day); } } maxBalanceList.append(maxDate); @@ -947,38 +947,38 @@ int MyMoneyForecast::calculateBeginForecastDay() //if 0, beginDate is current date and forecastDays remains unchanged if(beginDay == 0) { - setBeginForecastDate(TQDate::tqcurrentDate()); + setBeginForecastDate(TQDate::currentDate()); return fDays; } //adjust if beginDay more than days of current month - if(TQDate::tqcurrentDate().daysInMonth() < beginDay) - beginDay = TQDate::tqcurrentDate().daysInMonth(); + if(TQDate::currentDate().daysInMonth() < beginDay) + beginDay = TQDate::currentDate().daysInMonth(); //if beginDay still to come, calculate and return - if(TQDate::tqcurrentDate().day() <= beginDay) { - beginDate = TQDate( TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay); - fDays += TQDate::tqcurrentDate().daysTo(beginDate); + if(TQDate::currentDate().day() <= beginDay) { + beginDate = TQDate( TQDate::currentDate().year(), TQDate::currentDate().month(), beginDay); + fDays += TQDate::currentDate().daysTo(beginDate); setBeginForecastDate(beginDate); return fDays; } //adjust beginDay for next month - if(TQDate::tqcurrentDate().addMonths(1).daysInMonth() < beginDay) - beginDay = TQDate::tqcurrentDate().addMonths(1).daysInMonth(); + if(TQDate::currentDate().addMonths(1).daysInMonth() < beginDay) + beginDay = TQDate::currentDate().addMonths(1).daysInMonth(); //if beginDay of next month comes before 1 interval, use beginDay next month - if(TQDate::tqcurrentDate().addDays(accCycle) >= - (TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1).addDays(beginDay-1) ) ) + if(TQDate::currentDate().addDays(accCycle) >= + (TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1).addDays(beginDay-1) ) ) { - beginDate = TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1).addDays(beginDay-1); - fDays += TQDate::tqcurrentDate().daysTo(beginDate); + beginDate = TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1).addDays(beginDay-1); + fDays += TQDate::currentDate().daysTo(beginDate); } else //add intervals to current beginDay and take the first after current date { - beginDay = ((((TQDate::tqcurrentDate().day()-beginDay)/accCycle) + 1) * accCycle) + beginDay; - beginDate = TQDate::tqcurrentDate().addDays(beginDay - TQDate::tqcurrentDate().day()); - fDays += TQDate::tqcurrentDate().daysTo(beginDate); + beginDay = ((((TQDate::currentDate().day()-beginDay)/accCycle) + 1) * accCycle) + beginDay; + beginDate = TQDate::currentDate().addDays(beginDay - TQDate::currentDate().day()); + fDays += TQDate::currentDate().daysTo(beginDate); } setBeginForecastDate(beginDate); @@ -1190,15 +1190,15 @@ void MyMoneyForecast::setStartingBalance(const MyMoneyAccount &acc) //set the default value MyMoneyMoney rate = MyMoneyMoney ( 1, 1 ); //get te - MyMoneyPrice price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), TQDate::tqcurrentDate() ); + MyMoneyPrice price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), TQDate::currentDate() ); if ( price.isValid() ) { rate = price.rate ( undersecurity.tradingCurrency() ); } - m_accountList[acc.id()][TQDate::tqcurrentDate()] = file->balance(acc.id(), TQDate::tqcurrentDate()) * rate; + m_accountList[acc.id()][TQDate::currentDate()] = file->balance(acc.id(), TQDate::currentDate()) * rate; } } else { - m_accountList[acc.id()][TQDate::tqcurrentDate()] = file->balance(acc.id(), TQDate::tqcurrentDate()); + m_accountList[acc.id()][TQDate::currentDate()] = file->balance(acc.id(), TQDate::currentDate()); } //if the method is linear regression, we have to add the opening balance to m_accountListPast @@ -1267,8 +1267,8 @@ void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoney // the payment is overdue then take the current date dueDate = schedule.nextDueDate(); if(acc.interestCalculation() == MyMoneyAccountLoan::paymentReceived) { - if(dueDate < TQDate::tqcurrentDate()) - dueDate = TQDate::tqcurrentDate(); + if(dueDate < TQDate::currentDate()) + dueDate = TQDate::currentDate(); } // we need to calculate the balance at the time the payment is due diff --git a/kmymoney2/mymoney/mymoneyforecast.h b/kmymoney2/mymoney/mymoneyforecast.h index 7291b2b..6fa231c 100644 --- a/kmymoney2/mymoney/mymoneyforecast.h +++ b/kmymoney2/mymoney/mymoneyforecast.h @@ -141,8 +141,8 @@ public: void setForecastMethod(int forecastMethod) { m_forecastMethod = forecastMethod; } void setHistoryStartDate(TQDate historyStartDate) { m_historyStartDate = historyStartDate; } void setHistoryEndDate(TQDate historyEndDate) { m_historyEndDate = historyEndDate; } - void setHistoryStartDate(int daysToStartDate) { setHistoryStartDate(TQDate::tqcurrentDate().addDays(-daysToStartDate)); } - void setHistoryEndDate(int daysToEndDate) { setHistoryEndDate(TQDate::tqcurrentDate().addDays(-daysToEndDate)); } + void setHistoryStartDate(int daysToStartDate) { setHistoryStartDate(TQDate::currentDate().addDays(-daysToStartDate)); } + void setHistoryEndDate(int daysToEndDate) { setHistoryEndDate(TQDate::currentDate().addDays(-daysToEndDate)); } void setForecastStartDate(TQDate _startDate) { m_forecastStartDate = _startDate; } void setForecastEndDate(TQDate _endDate) { m_forecastEndDate = _endDate; } void setSkipOpeningDate(bool _skip) { m_skipOpeningDate = _skip; } diff --git a/kmymoney2/mymoney/mymoneyforecasttest.cpp b/kmymoney2/mymoney/mymoneyforecasttest.cpp index ffcd232..dc829cd 100644 --- a/kmymoney2/mymoney/mymoneyforecasttest.cpp +++ b/kmymoney2/mymoney/mymoneyforecasttest.cpp @@ -78,7 +78,7 @@ void MyMoneyForecastTest::setUp () { acGrandChild2 = makeAccount(TQString("Grand Child 2"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild, "USD"); //this account added to have an account to test opening date calculations - acCash = makeAccount(TQString("Cash"),MyMoneyAccount::Cash,moCreditOpen,TQDate::tqcurrentDate().addDays(-2),acAsset, "USD"); + acCash = makeAccount(TQString("Cash"),MyMoneyAccount::Cash,moCreditOpen,TQDate::currentDate().addDays(-2),acAsset, "USD"); MyMoneyInstitution i("Bank of the World","","","","","",""); @@ -97,18 +97,18 @@ void MyMoneyForecastTest::testEmptyConstructor() { MyMoneyForecast a; MyMoneyAccount b; - int f = a.forecastBalance(b, TQDate::tqcurrentDate()); + int f = a.forecastBalance(b, TQDate::currentDate()); CPPUNIT_ASSERT(f == 0); CPPUNIT_ASSERT(!a.isForecastAccount(b)); - CPPUNIT_ASSERT(a.forecastBalance(b, TQDate::tqcurrentDate()) == MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(b, TQDate::currentDate()) == MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.daysToMinimumBalance(b) == -1); CPPUNIT_ASSERT(a.daysToZeroBalance(b) == -2); CPPUNIT_ASSERT(a.forecastDays() == KMyMoneyGlobalSettings::forecastDays()); CPPUNIT_ASSERT(a.accountsCycle() == KMyMoneyGlobalSettings::forecastAccountCycle()); CPPUNIT_ASSERT(a.forecastCycles() == KMyMoneyGlobalSettings::forecastCycles()); - CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-KMyMoneyGlobalSettings::forecastCycles()*KMyMoneyGlobalSettings::forecastAccountCycle())); - CPPUNIT_ASSERT(a.historyEndDate() == TQDate::tqcurrentDate().addDays(-1)); + CPPUNIT_ASSERT(a.historyStartDate() == TQDate::currentDate().addDays(-KMyMoneyGlobalSettings::forecastCycles()*KMyMoneyGlobalSettings::forecastAccountCycle())); + CPPUNIT_ASSERT(a.historyEndDate() == TQDate::currentDate().addDays(-1)); CPPUNIT_ASSERT(a.historyDays() == KMyMoneyGlobalSettings::forecastAccountCycle() * KMyMoneyGlobalSettings::forecastCycles()); } @@ -177,9 +177,9 @@ void MyMoneyForecastTest::testDoForecast() { a.doForecast(); //this is just to check nothing goes wrong if forecast is run agains an empty template //setup some transactions - TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); - TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); + TransactionHelper t1( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); + TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); + TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); a.setForecastMethod(1); a.setForecastDays(3); @@ -190,32 +190,32 @@ void MyMoneyForecastTest::testDoForecast() { a.doForecast(); //checking didn't have balance variations, so the forecast should be equal to the current balance - MyMoneyMoney b_checking = file->balance(a_checking.id(), TQDate::tqcurrentDate()); + MyMoneyMoney b_checking = file->balance(a_checking.id(), TQDate::currentDate()); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(1))==b_checking); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(2))==b_checking); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(3))==b_checking); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate())==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(1))==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(2))==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(3))==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate())==b_checking); //credit had a variation so the forecast should be different for each day - MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate()); + MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::currentDate()); CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(moT2-moT1))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1)) == (b_credit+(moT2-moT1))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); a.setHistoryMethod(1); //weighted moving average a.doForecast(); CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(moT2-moT1))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1)) == (b_credit+(moT2-moT1))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); //insert transactions outside the forecast period. The calculation should be the same. - TransactionHelper t4( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); - TransactionHelper t5( TQDate::tqcurrentDate().addDays(-10), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); - TransactionHelper t6( TQDate::tqcurrentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); + TransactionHelper t4( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); + TransactionHelper t5( TQDate::currentDate().addDays(-10), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); + TransactionHelper t6( TQDate::currentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); a.setForecastMethod(1); a.setForecastDays(3); @@ -225,14 +225,14 @@ void MyMoneyForecastTest::testDoForecast() { a.setHistoryMethod(0); //moving average a.doForecast(); //check forecast - b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate()); + b_credit = file->balance(a_credit.id(), TQDate::currentDate()); MyMoneyMoney b_credit_1_exp = (b_credit+((moT2-moT1))); - MyMoneyMoney b_credit_2 = a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)); + MyMoneyMoney b_credit_2 = a.forecastBalance(a_credit, TQDate::currentDate().addDays(2)); MyMoneyMoney b_credit_2_exp = (b_credit+((moT2-moT1)*2)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate())==file->balance(a_credit.id(), TQDate::tqcurrentDate())); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1))==b_credit+(moT2-moT1)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2))==b_credit+((moT2-moT1)*2)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3))==b_credit+((moT2-moT1)*3)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate())==file->balance(a_credit.id(), TQDate::currentDate())); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1))==b_credit+(moT2-moT1)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(2))==b_credit+((moT2-moT1)*2)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(3))==b_credit+((moT2-moT1)*3)); //test weighted moving average a.setForecastMethod(1); @@ -244,7 +244,7 @@ void MyMoneyForecastTest::testDoForecast() { a.doForecast(); CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(((moT2-moT1)*3+moT2*2+moT2)/MyMoneyMoney(6,1)))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1)) == (b_credit+(((moT2-moT1)*3+moT2*2+moT2)/MyMoneyMoney(6,1)))); } @@ -265,7 +265,7 @@ void MyMoneyForecastTest::testGetForecastAccountList() void MyMoneyForecastTest::testCalculateAccountTrend() { //set up environment - TransactionHelper t1( TQDate::tqcurrentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acChecking, acSolo ); + TransactionHelper t1( TQDate::currentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acChecking, acSolo ); MyMoneyAccount a_checking = file->account(acChecking); //test invalid arguments @@ -296,8 +296,8 @@ void MyMoneyForecastTest::testCalculateAccountTrend() //test that it does not take into account the transactions of the opening date of the account MyMoneyAccount a_cash = file->account(acCash); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); - TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, moT1, acCash, acParent ); + TransactionHelper t2( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); + TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, moT1, acCash, acParent ); CPPUNIT_ASSERT(MyMoneyForecast::calculateAccountTrend(a_cash,3) == -moT1); } @@ -307,9 +307,9 @@ void MyMoneyForecastTest::testGetForecastBalance() //set up environment MyMoneyForecast a; - TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); - TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); + TransactionHelper t1( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); + TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); + TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); a.setForecastMethod(1); a.setForecastDays(3); @@ -322,23 +322,23 @@ void MyMoneyForecastTest::testGetForecastBalance() MyMoneyAccount a_credit = file->account(acCredit); //test invalid arguments - CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(-1))==MyMoneyMoney(0,1)); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(-10))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(-1))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(-10))==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, -1)==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, -100)==MyMoneyMoney(0,1)); //test a date outside the forecast days - CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(4))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(4))==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, 4)==MyMoneyMoney(0,1)); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(10))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(10))==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, 10)==MyMoneyMoney(0,1)); //test it returns valid results - MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate()); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate())==file->balance(a_credit.id(), TQDate::tqcurrentDate())); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1))==b_credit+(moT2-moT1)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2))==b_credit+((moT2-moT1)*2)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3))==b_credit+((moT2-moT1)*3)); + MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::currentDate()); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate())==file->balance(a_credit.id(), TQDate::currentDate())); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1))==b_credit+(moT2-moT1)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(2))==b_credit+((moT2-moT1)*2)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(3))==b_credit+((moT2-moT1)*3)); } void MyMoneyForecastTest::testIsForecastAccount() @@ -364,10 +364,10 @@ void MyMoneyForecastTest::testDoFutureScheduledForecast() MyMoneyForecast a; MyMoneyAccount a_cash = file->account(acCash); - TransactionHelper t1( TQDate::tqcurrentDate().addDays(1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionDeposit, -moT2, acCash, acParent ); - TransactionHelper t3( TQDate::tqcurrentDate().addDays(3), MyMoneySplit::ActionDeposit, -moT3, acCash, acParent ); - TransactionHelper t4( TQDate::tqcurrentDate().addDays(10), MyMoneySplit::ActionDeposit, -moT4, acCash, acParent ); + TransactionHelper t1( TQDate::currentDate().addDays(1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); + TransactionHelper t2( TQDate::currentDate().addDays(2), MyMoneySplit::ActionDeposit, -moT2, acCash, acParent ); + TransactionHelper t3( TQDate::currentDate().addDays(3), MyMoneySplit::ActionDeposit, -moT3, acCash, acParent ); + TransactionHelper t4( TQDate::currentDate().addDays(10), MyMoneySplit::ActionDeposit, -moT4, acCash, acParent ); a.setForecastMethod(0); a.setForecastDays(3); @@ -375,13 +375,13 @@ void MyMoneyForecastTest::testDoFutureScheduledForecast() a.setForecastCycles(1); a.doForecast(); - MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate()); + MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::currentDate()); //test valid results - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash+moT1); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash+moT1+moT2); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3))==b_cash+moT1+moT2+moT3); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate())==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(1))==b_cash+moT1); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(2))==b_cash+moT1+moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(3))==b_cash+moT1+moT2+moT3); } void MyMoneyForecastTest::testScheduleForecast() @@ -395,14 +395,14 @@ void MyMoneyForecastTest::testScheduleForecast() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - TQDate::tqcurrentDate().addDays(1), + TQDate::currentDate().addDays(1), TQDate(), true, true); MyMoneyTransaction t; - t.setPostDate(TQDate::tqcurrentDate().addDays(1)); - t.setEntryDate(TQDate::tqcurrentDate().addDays(1)); + t.setPostDate(TQDate::currentDate().addDays(1)); + t.setEntryDate(TQDate::currentDate().addDays(1)); //t.setId("T000000000000000001"); t.setBankID("BID"); t.setMemo("Wohnung:Miete"); @@ -437,18 +437,18 @@ void MyMoneyForecastTest::testScheduleForecast() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - TQDate::tqcurrentDate().addDays(5), + TQDate::currentDate().addDays(5), TQDate(), true, true); - //sch.setLastPayment(TQDate::tqcurrentDate()); - //sch.recordPayment(TQDate::tqcurrentDate().addDays(1)); + //sch.setLastPayment(TQDate::currentDate()); + //sch.recordPayment(TQDate::currentDate().addDays(1)); //sch.setId("SCH0001"); MyMoneyTransaction t3; - t3.setPostDate(TQDate::tqcurrentDate().addDays(5)); - t3.setEntryDate(TQDate::tqcurrentDate().addDays(5)); + t3.setPostDate(TQDate::currentDate().addDays(5)); + t3.setEntryDate(TQDate::currentDate().addDays(5)); //t.setId("T000000000000000001"); t3.setBankID("BID"); t3.setMemo("Wohnung:Miete"); @@ -484,18 +484,18 @@ void MyMoneyForecastTest::testScheduleForecast() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - TQDate::tqcurrentDate().addDays(2), + TQDate::currentDate().addDays(2), TQDate(), true, true); - //sch.setLastPayment(TQDate::tqcurrentDate()); - //sch.recordPayment(TQDate::tqcurrentDate().addDays(1)); + //sch.setLastPayment(TQDate::currentDate()); + //sch.recordPayment(TQDate::currentDate().addDays(1)); //sch.setId("SCH0001"); MyMoneyTransaction t2; - t2.setPostDate(TQDate::tqcurrentDate().addDays(2)); - t2.setEntryDate(TQDate::tqcurrentDate().addDays(2)); + t2.setPostDate(TQDate::currentDate().addDays(2)); + t2.setEntryDate(TQDate::currentDate().addDays(2)); //t.setId("T000000000000000001"); t2.setBankID("BID"); t2.setMemo("Wohnung:Miete"); @@ -535,13 +535,13 @@ void MyMoneyForecastTest::testScheduleForecast() a.doForecast(); //check result for single schedule - MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate()); - MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1)); + MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::currentDate()); + MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::currentDate().addDays(1)); //test valid results - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash-moT2); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash-moT2-moT1); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate())==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(1))==b_cash-moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(2))==b_cash-moT2-moT1); } @@ -555,10 +555,10 @@ void MyMoneyForecastTest::testDaysToMinimumBalance() MyMoneyAccount a_parent = file->account(acParent); a_cash.setValue("minBalanceAbsolute", "50"); a_credit.setValue("minBalanceAbsolute", "50"); - TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); - TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, -moT1, acCredit, acParent ); - TransactionHelper t4( TQDate::tqcurrentDate().addDays(4), MyMoneySplit::ActionWithdrawal, moT5, acCredit, acParent ); + TransactionHelper t1( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); + TransactionHelper t2( TQDate::currentDate().addDays(2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); + TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, -moT1, acCredit, acParent ); + TransactionHelper t4( TQDate::currentDate().addDays(4), MyMoneySplit::ActionWithdrawal, moT5, acCredit, acParent ); a.setForecastMethod(0); a.setForecastDays(3); @@ -588,9 +588,9 @@ void MyMoneyForecastTest::testDaysToZeroBalance() MyMoneyAccount a_Credit = file->account(acCredit); //MyMoneyFileTransaction ft; - TransactionHelper t1( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionWithdrawal, -moT1, acChecking, acSolo ); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionTransfer, (moT5), acCash, acCredit ); - TransactionHelper t3( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionWithdrawal, (moT5*100), acCredit, acParent ); + TransactionHelper t1( TQDate::currentDate().addDays(2), MyMoneySplit::ActionWithdrawal, -moT1, acChecking, acSolo ); + TransactionHelper t2( TQDate::currentDate().addDays(2), MyMoneySplit::ActionTransfer, (moT5), acCash, acCredit ); + TransactionHelper t3( TQDate::currentDate().addDays(2), MyMoneySplit::ActionWithdrawal, (moT5*100), acCredit, acParent ); //ft.commit(); MyMoneyForecast a; @@ -618,7 +618,7 @@ void MyMoneyForecastTest::testDaysToZeroBalance() //test it warns when inside the forecast period - MyMoneyMoney fCash = a.forecastBalance(a_Cash, TQDate::tqcurrentDate().addDays(2)); + MyMoneyMoney fCash = a.forecastBalance(a_Cash, TQDate::currentDate().addDays(2)); CPPUNIT_ASSERT(a.daysToZeroBalance(a_Cash) == 2); @@ -631,8 +631,8 @@ void MyMoneyForecastTest::testSkipOpeningDate() //set up environment MyMoneyForecast a; - TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(3); @@ -644,12 +644,12 @@ void MyMoneyForecastTest::testSkipOpeningDate() MyMoneyAccount a_cash = file->account(acCash); //test it has no variation because it skipped the variation of the opening date - MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate()); + MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::currentDate()); CPPUNIT_ASSERT(a.skipOpeningDate() == true); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash-moT2); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3))==b_cash-moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate())==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(1))==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(2))==b_cash-moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(3))==b_cash-moT2); } void MyMoneyForecastTest::testAccountMinimumBalanceDateList() { @@ -657,15 +657,15 @@ void MyMoneyForecastTest::testAccountMinimumBalanceDateList() { //set up environment MyMoneyForecast a; - TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(6); a.setAccountsCycle(2); a.setForecastCycles(3); a.setHistoryMethod(0); - a.setBeginForecastDay(TQDate::tqcurrentDate().addDays(1).day()); + a.setBeginForecastDay(TQDate::currentDate().addDays(1).day()); a.doForecast(); MyMoneyAccount a_cash = file->account(acCash); @@ -678,13 +678,13 @@ void MyMoneyForecastTest::testAccountMinimumBalanceDateList() { TQDate minDate = *it; - CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(2)); + CPPUNIT_ASSERT(minDate==TQDate::currentDate().addDays(2)); it++; minDate = *it; - CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(4)); + CPPUNIT_ASSERT(minDate==TQDate::currentDate().addDays(4)); it++; minDate = *it; - CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(6)); + CPPUNIT_ASSERT(minDate==TQDate::currentDate().addDays(6)); } @@ -692,15 +692,15 @@ void MyMoneyForecastTest::testAccountMaximumBalanceDateList() { //set up environment MyMoneyForecast a; - TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(6); a.setAccountsCycle(2); a.setForecastCycles(3); a.setHistoryMethod(0); - a.setBeginForecastDay(TQDate::tqcurrentDate().addDays(1).day()); + a.setBeginForecastDay(TQDate::currentDate().addDays(1).day()); a.doForecast(); MyMoneyAccount a_cash = file->account(acCash); @@ -713,13 +713,13 @@ void MyMoneyForecastTest::testAccountMaximumBalanceDateList() { TQDate maxDate = *it; - CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(1)); + CPPUNIT_ASSERT(maxDate==TQDate::currentDate().addDays(1)); it++; maxDate = *it; - CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(3)); + CPPUNIT_ASSERT(maxDate==TQDate::currentDate().addDays(3)); it++; maxDate = *it; - CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(5)); + CPPUNIT_ASSERT(maxDate==TQDate::currentDate().addDays(5)); } @@ -728,8 +728,8 @@ void MyMoneyForecastTest::testAccountAverageBalance() { //set up environment MyMoneyForecast a; - TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(3); @@ -741,9 +741,9 @@ void MyMoneyForecastTest::testAccountAverageBalance() { MyMoneyAccount a_cash = file->account(acCash); //test - MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1)); - MyMoneyMoney b_cash2 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2)); - MyMoneyMoney b_cash3 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3)); + MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::currentDate().addDays(1)); + MyMoneyMoney b_cash2 = a.forecastBalance(a_cash, TQDate::currentDate().addDays(2)); + MyMoneyMoney b_cash3 = a.forecastBalance(a_cash, TQDate::currentDate().addDays(3)); MyMoneyMoney average = (b_cash1 + b_cash2 +b_cash3)/MyMoneyMoney(3,1); @@ -765,7 +765,7 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.doForecast(); //test when using old method without begin day - CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate()); + CPPUNIT_ASSERT(TQDate::currentDate() == a.beginForecastDate()); //setup begin to last day of month a.setBeginForecastDay(31); @@ -773,22 +773,22 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.doForecast(); //test - if(TQDate::tqcurrentDate().day() < beginDay) + if(TQDate::currentDate().day() < beginDay) { - if(TQDate::tqcurrentDate().daysInMonth() < beginDay) - beginDay = TQDate::tqcurrentDate().daysInMonth(); + if(TQDate::currentDate().daysInMonth() < beginDay) + beginDay = TQDate::currentDate().daysInMonth(); - beginDate = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay); + beginDate = TQDate(TQDate::currentDate().year(), TQDate::currentDate().month(), beginDay); CPPUNIT_ASSERT(beginDate == a.beginForecastDate()); } //setup begin day to same date - a.setBeginForecastDay(TQDate::tqcurrentDate().day()); + a.setBeginForecastDay(TQDate::currentDate().day()); beginDay = a.beginForecastDay(); a.doForecast(); - CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate()); + CPPUNIT_ASSERT(TQDate::currentDate() == a.beginForecastDate()); //setup to first day of month with small interval a.setBeginForecastDay(1); @@ -797,14 +797,14 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.doForecast(); //test - if(TQDate::tqcurrentDate() == a.beginForecastDate()) { - CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate()); + if(TQDate::currentDate() == a.beginForecastDate()) { + CPPUNIT_ASSERT(TQDate::currentDate() == a.beginForecastDate()); } else { - beginDay = ((((TQDate::tqcurrentDate().day() - beginDay)/a.accountsCycle()) + 1) * a.accountsCycle()) + beginDay; - if(beginDay > TQDate::tqcurrentDate().daysInMonth()) - beginDay = TQDate::tqcurrentDate().daysInMonth(); - beginDate = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay); - if(TQDate::tqcurrentDate().day() == TQDate::tqcurrentDate().daysInMonth() ) { + beginDay = ((((TQDate::currentDate().day() - beginDay)/a.accountsCycle()) + 1) * a.accountsCycle()) + beginDay; + if(beginDay > TQDate::currentDate().daysInMonth()) + beginDay = TQDate::currentDate().daysInMonth(); + beginDate = TQDate(TQDate::currentDate().year(), TQDate::currentDate().month(), beginDay); + if(TQDate::currentDate().day() == TQDate::currentDate().daysInMonth() ) { std::cout << std::endl << "testBeginForecastDate(): test of first day of month with small interval skipped because it is the last day of month" << std::endl; } else { CPPUNIT_ASSERT(beginDate == a.beginForecastDate()); @@ -813,9 +813,9 @@ void MyMoneyForecastTest::testBeginForecastDate() { //setup to test when current date plus cycle equals begin day a.setAccountsCycle(14); - beginDay = TQDate::tqcurrentDate().addDays(14).day(); + beginDay = TQDate::currentDate().addDays(14).day(); a.setBeginForecastDay(beginDay); - beginDate = TQDate::tqcurrentDate().addDays(14); + beginDate = TQDate::currentDate().addDays(14); a.doForecast(); //test @@ -826,10 +826,10 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.setAccountsCycle(40); a.doForecast(); - beginDate = TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1); + beginDate = TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1); //test - if(TQDate::tqcurrentDate().day() > 1) { + if(TQDate::currentDate().day() > 1) { CPPUNIT_ASSERT(beginDate == a.beginForecastDate()); } else { //test is not valid if today is 1st of month @@ -841,8 +841,8 @@ void MyMoneyForecastTest::testBeginForecastDate() { { MyMoneyForecast a; - CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-a.forecastCycles()*a.accountsCycle()) ); - CPPUNIT_ASSERT(a.historyEndDate() == TQDate::tqcurrentDate().addDays(-1) ); + CPPUNIT_ASSERT(a.historyStartDate() == TQDate::currentDate().addDays(-a.forecastCycles()*a.accountsCycle()) ); + CPPUNIT_ASSERT(a.historyEndDate() == TQDate::currentDate().addDays(-1) ); CPPUNIT_ASSERT(a.historyDays() == a.forecastCycles()*a.accountsCycle()); a.setForecastMethod(1); @@ -852,9 +852,9 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.setBeginForecastDay(0); a.doForecast(); - CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-14*3) ); + CPPUNIT_ASSERT(a.historyStartDate() == TQDate::currentDate().addDays(-14*3) ); CPPUNIT_ASSERT(a.historyDays() == (14*3)); - CPPUNIT_ASSERT(a.historyEndDate() == (TQDate::tqcurrentDate().addDays(-1)) ); + CPPUNIT_ASSERT(a.historyEndDate() == (TQDate::currentDate().addDays(-1)) ); } void MyMoneyForecastTest::testCreateBudget() @@ -910,14 +910,14 @@ void MyMoneyForecastTest::testCreateBudget() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_MONTHLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - TQDate::tqcurrentDate(), + TQDate::currentDate(), TQDate(), true, true); MyMoneyTransaction t10; - t10.setPostDate(TQDate::tqcurrentDate().addMonths(1)); - t10.setEntryDate(TQDate::tqcurrentDate().addMonths(1)); + t10.setPostDate(TQDate::currentDate().addMonths(1)); + t10.setEntryDate(TQDate::currentDate().addMonths(1)); //t.setId("T000000000000000001"); t10.setBankID("BID"); t10.setMemo("Wohnung:Miete"); @@ -951,12 +951,12 @@ void MyMoneyForecastTest::testCreateBudget() MyMoneyForecast c; c.setForecastMethod(0); c.setForecastCycles(1); - c.createBudget(budget, TQDate::tqcurrentDate().addYears(-2), TQDate::tqcurrentDate().addYears(-1), TQDate::tqcurrentDate().addMonths(-2), TQDate::tqcurrentDate().addMonths(6), true); + c.createBudget(budget, TQDate::currentDate().addYears(-2), TQDate::currentDate().addYears(-1), TQDate::currentDate().addMonths(-2), TQDate::currentDate().addMonths(6), true); - MyMoneyMoney c_parent = c.forecastBalance(a_parent, TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1) ); + MyMoneyMoney c_parent = c.forecastBalance(a_parent, TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1) ); //test valid results - CPPUNIT_ASSERT(c.forecastBalance(a_parent, TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1) ) == (moT2)); + CPPUNIT_ASSERT(c.forecastBalance(a_parent, TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1) ) == (moT2)); } void MyMoneyForecastTest::testLinearRegression() { @@ -967,9 +967,9 @@ void MyMoneyForecastTest::testLinearRegression() { MyMoneyAccount a_credit = file->account(acCredit); //setup some transactions - TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); - TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); - TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); + TransactionHelper t1( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); + TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); + TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); //TODO Add tests specific for linear regression diff --git a/kmymoney2/mymoney/mymoneyreport.cpp b/kmymoney2/mymoney/mymoneyreport.cpp index 2904ed5..432a352 100644 --- a/kmymoney2/mymoney/mymoneyreport.cpp +++ b/kmymoney2/mymoney/mymoneyreport.cpp @@ -201,8 +201,8 @@ void MyMoneyReport::validDateRange ( TQDate& _db, TQDate& _de ) tmpBegin = list.front().postDate(); tmpEnd = list.back().postDate(); } else { - tmpBegin = TQDate ( TQDate::tqcurrentDate().year(), 1, 1 ); // the first date in the file - tmpEnd = TQDate ( TQDate::tqcurrentDate().year(), 12, 31 );// the last date in the file + tmpBegin = TQDate ( TQDate::currentDate().year(), 1, 1 ); // the first date in the file + tmpEnd = TQDate ( TQDate::currentDate().year(), 12, 31 );// the last date in the file } if ( !_db.isValid() ) _db = tmpBegin; diff --git a/kmymoney2/mymoney/mymoneyscheduled.cpp b/kmymoney2/mymoney/mymoneyscheduled.cpp index 594bc69..9bbedcd 100644 --- a/kmymoney2/mymoney/mymoneyscheduled.cpp +++ b/kmymoney2/mymoney/mymoneyscheduled.cpp @@ -680,7 +680,7 @@ bool MyMoneySchedule::isOverdue() const if (isFinished()) return false; - if(adjustedNextDueDate() >= TQDate::tqcurrentDate()) + if(adjustedNextDueDate() >= TQDate::currentDate()) return false; return true; diff --git a/kmymoney2/mymoney/mymoneyscheduled.h b/kmymoney2/mymoney/mymoneyscheduled.h index cf5cb07..9f8fedd 100644 --- a/kmymoney2/mymoney/mymoneyscheduled.h +++ b/kmymoney2/mymoney/mymoneyscheduled.h @@ -409,7 +409,7 @@ public: * are no more payments then an empty/invalid TQDate() will * be returned. */ - TQDate adjustedNextPayment(const TQDate& refDate = TQDate::tqcurrentDate()) const; + TQDate adjustedNextPayment(const TQDate& refDate = TQDate::currentDate()) const; /** * Calculates the date of the next payment. @@ -422,7 +422,7 @@ public: * if there is no more payments then an empty/invalid TQDate() * will be returned. */ - TQDate nextPayment(const TQDate& refDate = TQDate::tqcurrentDate()) const; + TQDate nextPayment(const TQDate& refDate = TQDate::currentDate()) const; /** * Calculates the dates of the payment over a certain period of time. diff --git a/kmymoney2/mymoney/mymoneyscheduletest.cpp b/kmymoney2/mymoney/mymoneyscheduletest.cpp index 07b3cc6..d3c20d2 100644 --- a/kmymoney2/mymoney/mymoneyscheduletest.cpp +++ b/kmymoney2/mymoney/mymoneyscheduletest.cpp @@ -55,7 +55,7 @@ void MyMoneyScheduleTest::testConstructor() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - TQDate::tqcurrentDate(), + TQDate::currentDate(), TQDate(), true, true); @@ -82,8 +82,8 @@ void MyMoneyScheduleTest::testSetFunctions() { s.setType(MyMoneySchedule::TYPE_BILL); CPPUNIT_ASSERT(s.type() == MyMoneySchedule::TYPE_BILL); - s.setEndDate(TQDate::tqcurrentDate()); - CPPUNIT_ASSERT(s.endDate() == TQDate::tqcurrentDate()); + s.setEndDate(TQDate::currentDate()); + CPPUNIT_ASSERT(s.endDate() == TQDate::currentDate()); CPPUNIT_ASSERT(s.willEnd() == true); } @@ -229,16 +229,16 @@ void MyMoneyScheduleTest::testOverdue() MyMoneySchedule sch_overdue; MyMoneySchedule sch_intime; - // the following checks only work correctly, if tqcurrentDate() is + // the following checks only work correctly, if currentDate() is // between the 1st and 27th. If it is between 28th and 31st // we don't perform them. Note: this should be fixed. - if(TQDate::tqcurrentDate().day() > 27 || TQDate::tqcurrentDate().day() == 1) { + if(TQDate::currentDate().day() > 27 || TQDate::currentDate().day() == 1) { std::cout << std::endl << "testOverdue() skipped because current day is between 28th and 2nd" << std::endl; return; } - TQDate startDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-23); - TQDate lastPaymentDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-1); + TQDate startDate = TQDate::currentDate().addDays(-1).addMonths(-23); + TQDate lastPaymentDate = TQDate::currentDate().addDays(-1).addMonths(-1); TQString ref = TQString( "<!DOCTYPE TEST>\n" @@ -1010,13 +1010,13 @@ void MyMoneyScheduleTest::testWriteXML() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 123, MyMoneySchedule::STYPE_DIRECTDEBIT, - TQDate::tqcurrentDate(), + TQDate::currentDate(), TQDate(), true, true); - sch.setLastPayment(TQDate::tqcurrentDate()); - sch.recordPayment(TQDate::tqcurrentDate()); + sch.setLastPayment(TQDate::currentDate()); + sch.recordPayment(TQDate::currentDate()); sch.setId("SCH0001"); MyMoneyTransaction t; @@ -1070,9 +1070,9 @@ void MyMoneyScheduleTest::testWriteXML() { " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)); CPPUNIT_ASSERT(doc.toString() == ref); } @@ -1098,9 +1098,9 @@ void MyMoneyScheduleTest::testReadXML() { " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)); // diff to ref_ok1 is that we now have an empty entrydate // in the transaction parameters @@ -1122,9 +1122,9 @@ void MyMoneyScheduleTest::testReadXML() { " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)); TQString ref_false = TQString( "<!DOCTYPE TEST>\n" @@ -1144,9 +1144,9 @@ void MyMoneyScheduleTest::testReadXML() { " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)); TQDomDocument doc; TQDomElement node; @@ -1167,13 +1167,13 @@ void MyMoneyScheduleTest::testReadXML() { try { sch = MyMoneySchedule(node); CPPUNIT_ASSERT(sch.id() == "SCH0002"); - CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7)); - CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::currentDate().addDays(7)); + CPPUNIT_ASSERT(sch.startDate() == TQDate::currentDate()); CPPUNIT_ASSERT(sch.endDate() == TQDate()); CPPUNIT_ASSERT(sch.autoEnter() == true); CPPUNIT_ASSERT(sch.isFixed() == true); CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing); - CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.lastPayment() == TQDate::currentDate()); CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT); CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL); CPPUNIT_ASSERT(sch.name() == "A Name"); @@ -1181,7 +1181,7 @@ void MyMoneyScheduleTest::testReadXML() { CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1); CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7)); CPPUNIT_ASSERT(sch.recordedPayments().count() == 1); - CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::currentDate()); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); @@ -1194,13 +1194,13 @@ void MyMoneyScheduleTest::testReadXML() { try { sch = MyMoneySchedule(node); CPPUNIT_ASSERT(sch.id() == "SCH0002"); - CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7)); - CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::currentDate().addDays(7)); + CPPUNIT_ASSERT(sch.startDate() == TQDate::currentDate()); CPPUNIT_ASSERT(sch.endDate() == TQDate()); CPPUNIT_ASSERT(sch.autoEnter() == true); CPPUNIT_ASSERT(sch.isFixed() == true); CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing); - CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.lastPayment() == TQDate::currentDate()); CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT); CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL); CPPUNIT_ASSERT(sch.name() == "A Name"); @@ -1208,7 +1208,7 @@ void MyMoneyScheduleTest::testReadXML() { CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1); CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7)); CPPUNIT_ASSERT(sch.recordedPayments().count() == 1); - CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::currentDate()); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); @@ -1236,9 +1236,9 @@ void MyMoneyScheduleTest::testHasReferenceTo() " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) - .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)) + .tqarg(TQDate::currentDate().toString(Qt::ISODate)); TQDomDocument doc; TQDomElement node; @@ -1872,7 +1872,7 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime() // https://bugs.kde.org/show_bug.cgi?id=231029 MyMoneySchedule sch; - TQDate paymentInFuture = TQDate::tqcurrentDate().addDays(7); + TQDate paymentInFuture = TQDate::currentDate().addDays(7); TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" @@ -1900,7 +1900,7 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime() sch = MyMoneySchedule(node); CPPUNIT_ASSERT(sch.isFinished() == true); CPPUNIT_ASSERT(sch.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY); - CPPUNIT_ASSERT(sch.paymentDates(TQDate::tqcurrentDate(), TQDate::tqcurrentDate().addDays(21)).count() == 0); + CPPUNIT_ASSERT(sch.paymentDates(TQDate::currentDate(), TQDate::currentDate().addDays(21)).count() == 0); } catch (MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); diff --git a/kmymoney2/mymoney/mymoneytransaction.cpp b/kmymoney2/mymoney/mymoneytransaction.cpp index 79f4fd9..38bb669 100644 --- a/kmymoney2/mymoney/mymoneytransaction.cpp +++ b/kmymoney2/mymoney/mymoneytransaction.cpp @@ -39,7 +39,7 @@ MyMoneyTransaction::MyMoneyTransaction(const TQString id, const MyMoneyTransacti *this = transaction; m_id = id; if(m_entryDate == TQDate()) - m_entryDate = TQDate::tqcurrentDate(); + m_entryDate = TQDate::currentDate(); TQValueList<MyMoneySplit>::Iterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { diff --git a/kmymoney2/mymoney/mymoneytransactionfilter.cpp b/kmymoney2/mymoney/mymoneytransactionfilter.cpp index 7998051..ba3c4b6 100644 --- a/kmymoney2/mymoney/mymoneytransactionfilter.cpp +++ b/kmymoney2/mymoney/mymoneytransactionfilter.cpp @@ -711,9 +711,9 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start, { bool rc = true; int yr, mon, day; - yr = TQDate::tqcurrentDate().year(); - mon = TQDate::tqcurrentDate().month(); - day = TQDate::tqcurrentDate().day(); + yr = TQDate::currentDate().year(); + mon = TQDate::currentDate().month(); + day = TQDate::currentDate().day(); TQDate tmp; switch(id) { @@ -723,7 +723,7 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start, break; case MyMoneyTransactionFilter::asOfToday: start = TQDate(); - end = TQDate::tqcurrentDate(); + end = TQDate::currentDate(); break; case MyMoneyTransactionFilter::currentMonth: start = TQDate(yr,mon,1); @@ -735,11 +735,11 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start, break; case MyMoneyTransactionFilter::monthToDate: start = TQDate(yr,mon,1); - end = TQDate::tqcurrentDate(); + end = TQDate::currentDate(); break; case MyMoneyTransactionFilter::yearToDate: start = TQDate(yr,1,1); - end = TQDate::tqcurrentDate(); + end = TQDate::currentDate(); break; case MyMoneyTransactionFilter::yearToMonth: start = TQDate(yr,1,1); @@ -754,56 +754,56 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start, end = TQDate(yr,12,31).addYears(-1); break; case MyMoneyTransactionFilter::last7Days: - start = TQDate::tqcurrentDate().addDays(-7); - end = TQDate::tqcurrentDate(); + start = TQDate::currentDate().addDays(-7); + end = TQDate::currentDate(); break; case MyMoneyTransactionFilter::last30Days: - start = TQDate::tqcurrentDate().addDays(-30); - end = TQDate::tqcurrentDate(); + start = TQDate::currentDate().addDays(-30); + end = TQDate::currentDate(); break; case MyMoneyTransactionFilter::last3Months: - start = TQDate::tqcurrentDate().addMonths(-3); - end = TQDate::tqcurrentDate(); + start = TQDate::currentDate().addMonths(-3); + end = TQDate::currentDate(); break; case MyMoneyTransactionFilter::last6Months: - start = TQDate::tqcurrentDate().addMonths(-6); - end = TQDate::tqcurrentDate(); + start = TQDate::currentDate().addMonths(-6); + end = TQDate::currentDate(); break; case MyMoneyTransactionFilter::last11Months: start = TQDate(yr,mon,1).addMonths(-12); end = TQDate(yr,mon,1).addDays(-1); break; case MyMoneyTransactionFilter::last12Months: - start = TQDate::tqcurrentDate().addMonths(-12); - end = TQDate::tqcurrentDate(); + start = TQDate::currentDate().addMonths(-12); + end = TQDate::currentDate(); break; case MyMoneyTransactionFilter::next7Days: - start = TQDate::tqcurrentDate(); - end = TQDate::tqcurrentDate().addDays(7); + start = TQDate::currentDate(); + end = TQDate::currentDate().addDays(7); break; case MyMoneyTransactionFilter::next30Days: - start = TQDate::tqcurrentDate(); - end = TQDate::tqcurrentDate().addDays(30); + start = TQDate::currentDate(); + end = TQDate::currentDate().addDays(30); break; case MyMoneyTransactionFilter::next3Months: - start = TQDate::tqcurrentDate(); - end = TQDate::tqcurrentDate().addMonths(3); + start = TQDate::currentDate(); + end = TQDate::currentDate().addMonths(3); break; case MyMoneyTransactionFilter::next6Months: - start = TQDate::tqcurrentDate(); - end = TQDate::tqcurrentDate().addMonths(6); + start = TQDate::currentDate(); + end = TQDate::currentDate().addMonths(6); break; case MyMoneyTransactionFilter::next12Months: - start = TQDate::tqcurrentDate(); - end = TQDate::tqcurrentDate().addMonths(12); + start = TQDate::currentDate(); + end = TQDate::currentDate().addMonths(12); break; case MyMoneyTransactionFilter::userDefined: start = TQDate(); end = TQDate(); break; case MyMoneyTransactionFilter::last3ToNext3Months: - start = TQDate::tqcurrentDate().addMonths(-3); - end = TQDate::tqcurrentDate().addMonths(3); + start = TQDate::currentDate().addMonths(-3); + end = TQDate::currentDate().addMonths(3); break; case MyMoneyTransactionFilter::currentQuarter: start = TQDate(yr, mon - ((mon-1) % 3), 1); @@ -818,21 +818,21 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start, end = start.addMonths(3).addDays(-1); break; case MyMoneyTransactionFilter::currentFiscalYear: - start = TQDate(TQDate::tqcurrentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); - if(TQDate::tqcurrentDate() < start) + start = TQDate(TQDate::currentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); + if(TQDate::currentDate() < start) start = start.addYears(-1); end = start.addYears(1).addDays(-1); break; case MyMoneyTransactionFilter::lastFiscalYear: - start = TQDate(TQDate::tqcurrentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); - if(TQDate::tqcurrentDate() < start) + start = TQDate(TQDate::currentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); + if(TQDate::currentDate() < start) start = start.addYears(-1); start = start.addYears(-1); end = start.addYears(1).addDays(-1); break; case MyMoneyTransactionFilter::today: - start = TQDate::tqcurrentDate(); - end = TQDate::tqcurrentDate(); + start = TQDate::currentDate(); + end = TQDate::currentDate(); break; default: qFatal("Unknown date identifier %d in MyMoneyTransactionFilter::translateDateRange()", id); diff --git a/kmymoney2/mymoney/mymoneytransactiontest.cpp b/kmymoney2/mymoney/mymoneytransactiontest.cpp index 155dfe0..b69ade8 100644 --- a/kmymoney2/mymoney/mymoneytransactiontest.cpp +++ b/kmymoney2/mymoney/mymoneytransactiontest.cpp @@ -49,7 +49,7 @@ void MyMoneyTransactionTest::testConstructor() { MyMoneyTransaction a("ID", *m); CPPUNIT_ASSERT(a.id() == "ID"); - CPPUNIT_ASSERT(a.entryDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.entryDate() == TQDate::currentDate()); CPPUNIT_ASSERT(a.memo() == "Memo"); CPPUNIT_ASSERT(a.postDate() == TQDate(1,2,3)); } @@ -62,7 +62,7 @@ void MyMoneyTransactionTest::testCopyConstructor() { MyMoneyTransaction n(a); CPPUNIT_ASSERT(n.id() == "ID"); - CPPUNIT_ASSERT(n.entryDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(n.entryDate() == TQDate::currentDate()); CPPUNIT_ASSERT(n.memo() == "Memo"); CPPUNIT_ASSERT(n.postDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.value("Key") == "Value"); @@ -78,7 +78,7 @@ void MyMoneyTransactionTest::testAssignmentConstructor() { n = a; CPPUNIT_ASSERT(n.id() == "ID"); - CPPUNIT_ASSERT(n.entryDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(n.entryDate() == TQDate::currentDate()); CPPUNIT_ASSERT(n.memo() == "Memo"); CPPUNIT_ASSERT(n.postDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.value("Key") == "Value"); diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp index a80d5af..7cbcb6b 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp @@ -26,8 +26,8 @@ #define PASS } catch (MyMoneyException *e) { throw; } MyMoneyDatabaseMgr::MyMoneyDatabaseMgr() : -m_creationDate (TQDate::tqcurrentDate ()), -m_lastModificationDate (TQDate::tqcurrentDate ()), +m_creationDate (TQDate::currentDate ()), +m_lastModificationDate (TQDate::currentDate ()), m_sql (0) { } @@ -913,7 +913,7 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate& //DEBUG TQDate date_ (date); - //if (date_ == TQDate()) date_ = TQDate::tqcurrentDate(); + //if (date_ == TQDate()) date_ = TQDate::currentDate(); // END DEBUG MyMoneyMoney result(0); @@ -1278,7 +1278,7 @@ const TQValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleList(const TQStri TQDate nextPayment = (*pos).nextPayment((*pos).lastPayment()); if(!nextPayment.isValid()) continue; - if(nextPayment >= TQDate::tqcurrentDate()) + if(nextPayment >= TQDate::currentDate()) continue; */ } diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp index d0d2065..cf76cb6 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp @@ -70,7 +70,7 @@ void MyMoneyDatabaseMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->payeeList().count() == 0); CPPUNIT_ASSERT(m->scheduleList().count() == 0); - CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::currentDate()); } void MyMoneyDatabaseMgrTest::testCreateDb() { @@ -118,8 +118,8 @@ void MyMoneyDatabaseMgrTest::testAttachDb() { MyMoneyFile::instance()->detachStorage(); KSharedPtr <MyMoneyStorageSql> sql = m->connectToDatabase(m_url); CPPUNIT_ASSERT(sql); - int opentqStatus = sql->open(m_url, IO_ReadWrite); - CPPUNIT_ASSERT(0 == opentqStatus); + int openStatus = sql->open(m_url, IO_ReadWrite); + CPPUNIT_ASSERT(0 == openStatus); MyMoneyFile::instance()->attachStorage(m); m->startTransaction(); m_dbAttached = true; @@ -717,7 +717,7 @@ void MyMoneyDatabaseMgrTest::testAddBudget() { MyMoneyBudget budget; budget.setName("TestBudget"); - budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime)); + budget.setBudgetStart(TQDate::currentDate(TQt::LocalTime)); m->addBudget(budget); @@ -773,7 +773,7 @@ void MyMoneyDatabaseMgrTest::testModifyBudget() { MyMoneyBudget budget = m->budgetByName("TestBudget"); - budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime).addDays(-1)); + budget.setBudgetStart(TQDate::currentDate(TQt::LocalTime).addDays(-1)); m->modifyBudget(budget); @@ -1650,7 +1650,7 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { // put some accounts in the db, so the tests don't break testReparentAccount(); - TQDate testDate = TQDate::tqcurrentDate(); + TQDate testDate = TQDate::currentDate(); TQDate notOverdue = testDate.addDays(2); TQDate overdue = testDate.addDays(-2); diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp index ef4c3a9..da9a40c 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp @@ -44,7 +44,7 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr() m_nextBudgetID = 0; m_user = MyMoneyPayee(); m_dirty = false; - m_creationDate = TQDate::tqcurrentDate(); + m_creationDate = TQDate::currentDate(); // setup standard accounts MyMoneyAccount acc_l; @@ -448,7 +448,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const void MyMoneySeqAccessMgr::touch(void) { m_dirty = true; - m_lastModificationDate = TQDate::tqcurrentDate(); + m_lastModificationDate = TQDate::currentDate(); } bool MyMoneySeqAccessMgr::hasActiveSplits(const TQString& id) const @@ -1731,7 +1731,7 @@ const MyMoneyPrice MyMoneySeqAccessMgr::price(const TQString& fromId, const TQSt // If no valid date is passed, we use today's date. if(!date.isValid()) - date = TQDate::tqcurrentDate(); + date = TQDate::currentDate(); // If the caller selected an exact entry, we can search for // it using the date as the key diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h index 0aebe23..e054613 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h @@ -939,7 +939,7 @@ public: /** * This method retrieves a price from the price list. - * If @p date is inValid, TQDate::tqcurrentDate() is assumed. + * If @p date is inValid, TQDate::currentDate() is assumed. */ const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const; diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp index 94d98f5..9c36204 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp @@ -63,7 +63,7 @@ void MyMoneySeqAccessMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->m_scheduleList.count() == 0); CPPUNIT_ASSERT(m->m_dirty == false); - CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::currentDate()); CPPUNIT_ASSERT(m->liability().name() == "Liability"); CPPUNIT_ASSERT(m->asset().name() == "Asset"); @@ -1302,7 +1302,7 @@ void MyMoneySeqAccessMgrTest::testRemoveSchedule() { } void MyMoneySeqAccessMgrTest::testScheduleList() { - TQDate testDate = TQDate::tqcurrentDate(); + TQDate testDate = TQDate::currentDate(); TQDate notOverdue = testDate.addDays(2); TQDate overdue = testDate.addDays(-2); diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp index 8f6a4f3..7973519 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp @@ -118,7 +118,7 @@ MyMoneyStorageSql::MyMoneyStorageSql (IMyMoneySerialize *storage, const KURL& ur DBG("*** Entering MyMoneyStorageSql::MyMoneyStorageSql"); m_dbVersion = 0; m_progressCallback = 0; - m_displaytqStatus = false; + m_displayStatus = false; m_storage = storage; m_storagePtr = dynamic_cast<IMyMoneyStorage*>(storage); m_newDatabase = false; @@ -200,7 +200,7 @@ try { rc = -1; } else { m_logonUser = url.user() + "@" + url.host(); - m_logonAt = TQDateTime::tqcurrentDateTime(); + m_logonAt = TQDateTime::currentDateTime(); writeFileInfo(); } return(rc); @@ -821,7 +821,7 @@ void MyMoneyStorageSql::clean() { bool MyMoneyStorageSql::readFile(void) { DBG("*** Entering MyMoneyStorageSql::readFile"); - m_displaytqStatus = true; + m_displayStatus = true; try { readFileInfo(); readInstitutions(); @@ -860,7 +860,7 @@ bool MyMoneyStorageSql::readFile(void) { // FIXME?? if (m_mode == 0) m_storage = NULL; // make sure the progress bar is not shown any longer signalProgress(-1, -1); - m_displaytqStatus = false; + m_displayStatus = false; //MyMoneySqlQuery::traceOn(); return true; } catch (TQString& s) { @@ -876,7 +876,7 @@ bool MyMoneyStorageSql::writeFile(void) { = m_securities = m_prices = m_currencies = m_schedules = m_reports = m_kvps = m_budgets = 0; m_hiIdInstitutions = m_hiIdPayees = m_hiIdAccounts = m_hiIdTransactions = m_hiIdSchedules = m_hiIdSecurities = m_hiIdReports = m_hiIdBudgets = 0; - m_displaytqStatus = true; + m_displayStatus = true; try{ startCommitUnit(__func__); writeInstitutions (); @@ -897,7 +897,7 @@ bool MyMoneyStorageSql::writeFile(void) { endCommitUnit(__func__); // make sure the progress bar is not shown any longer signalProgress(-1, -1); - m_displaytqStatus = false; + m_displayStatus = false; return true; } catch (TQString& s) { return false; @@ -2167,7 +2167,7 @@ void MyMoneyStorageSql::writeFileInfo() { q.bindValue(":fixLevel", m_storage->fileFixVersion()); q.bindValue(":created", TQString(m_storage->creationDate().toString(Qt::ISODate))); //q.bindValue(":lastModified", m_storage->lastModificationDate().toString(Qt::ISODate)); - q.bindValue(":lastModified", TQString(TQDate::tqcurrentDate().toString(Qt::ISODate))); + q.bindValue(":lastModified", TQString(TQDate::currentDate().toString(Qt::ISODate))); q.bindValue(":baseCurrency", m_storage->pairs()["kmm-baseCurrency"]); q.bindValue(":institutions", (unsigned long long) m_institutions); q.bindValue(":accounts", (unsigned long long) m_accounts); @@ -2410,7 +2410,7 @@ void MyMoneyStorageSql::readPayees(const TQValueList<TQString> pid) { const TQMap<TQString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const TQStringList& idList, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readPayees"); - if (m_displaytqStatus) { + if (m_displayStatus) { signalProgress(0, m_payees, TQObject::tr("Loading payees...")); } else { // if (m_payeeListRead) return; @@ -2472,7 +2472,7 @@ const TQMap<TQString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const TQStri //if(id > lastId) // lastId = id; } - if (m_displaytqStatus) signalProgress(++progress, 0); + if (m_displayStatus) signalProgress(++progress, 0); } return pList; } @@ -2666,7 +2666,7 @@ void MyMoneyStorageSql::readTransactions(const MyMoneyTransactionFilter& filter) const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (const TQString& tidList, const TQString& dateClause, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readTransactions"); // if (m_transactionListRead) return; // all list already in memory - if (m_displaytqStatus) signalProgress(0, m_transactions, TQObject::tr("Loading transactions...")); + if (m_displayStatus) signalProgress(0, m_transactions, TQObject::tr("Loading transactions...")); int progress = 0; // m_payeeList.clear(); TQString whereClause; @@ -2748,7 +2748,7 @@ const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions ( i != txMapEnd; ++i) { i.data().setPairs(kvpMap[i.data().id()].pairs()); - if (m_displaytqStatus) signalProgress(++progress, 0); + if (m_displayStatus) signalProgress(++progress, 0); } if ((tidList.isEmpty()) && (dateClause.isEmpty())) { @@ -3245,7 +3245,7 @@ const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const TQString& fromIdL TQDate date (date_); if(!date.isValid()) - date = TQDate::tqcurrentDate(); + date = TQDate::currentDate(); q.bindValue(":fromId", fromIdList); q.bindValue(":toId", toIdList); @@ -4131,9 +4131,9 @@ const TQString MyMoneyDbDef::generateSQL (const TQString& driver) const { replace = TQString::number (MyMoneyFile::instance()->storage()->currentFixVersion()); if ((*fit)->name() == "created") - replace = TQDate::tqcurrentDate().toString(Qt::ISODate); + replace = TQDate::currentDate().toString(Qt::ISODate); if ((*fit)->name() == "lastModified") - replace = TQDate::tqcurrentDate().toString(Qt::ISODate); + replace = TQDate::currentDate().toString(Qt::ISODate); if ((*fit)->name() == "updateInProgress") replace = enclose("N"); qs.replace(toReplace, replace); diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.h b/kmymoney2/mymoney/storage/mymoneystoragesql.h index 4250256..52db295 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.h +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.h @@ -747,7 +747,7 @@ private: * initial data load and final write */ - bool m_displaytqStatus; + bool m_displayStatus; /** * On occasions, e.g. after a complex transaction search, or for populating a * payee popup list, it becomes necessary to load all data into memory. The |