diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
commit | fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch) | |
tree | 6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/reports/pivottabletest.cpp | |
parent | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff) | |
download | kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip |
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/reports/pivottabletest.cpp')
-rw-r--r-- | kmymoney2/reports/pivottabletest.cpp | 322 |
1 files changed, 161 insertions, 161 deletions
diff --git a/kmymoney2/reports/pivottabletest.cpp b/kmymoney2/reports/pivottabletest.cpp index a235c0b..f5dbe12 100644 --- a/kmymoney2/reports/pivottabletest.cpp +++ b/kmymoney2/reports/pivottabletest.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ -#include <qvaluelist.h> -#include <qvaluevector.h> -#include <qdom.h> -#include <qfile.h> +#include <tqvaluelist.h> +#include <tqvaluevector.h> +#include <tqdom.h> +#include <tqfile.h> #include <kdebug.h> #include <kdeversion.h> @@ -60,7 +60,7 @@ void PivotTableTest::setUp () MyMoneyFileTransaction ft; file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -73,16 +73,16 @@ void PivotTableTest::setUp () acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount(QString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,QDate(2004,5,15),acAsset); - acCredit = makeAccount(QString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,QDate(2004,7,15),acLiability); - acSolo = makeAccount(QString("Solo"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acParent = makeAccount(QString("Parent"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acChild = makeAccount(QString("Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acForeign = makeAccount(QString("Foreign"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); + acChecking = makeAccount(TQString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,TQDate(2004,5,15),acAsset); + acCredit = makeAccount(TQString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,TQDate(2004,7,15),acLiability); + acSolo = makeAccount(TQString("Solo"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acParent = makeAccount(TQString("Parent"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acChild = makeAccount(TQString("Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acForeign = makeAccount(TQString("Foreign"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); - acSecondChild = makeAccount(QString("Second Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acGrandChild1 = makeAccount(QString("Grand Child 1"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); - acGrandChild2 = makeAccount(QString("Grand Child 2"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); + acSecondChild = makeAccount(TQString("Second Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acGrandChild1 = makeAccount(TQString("Grand Child 1"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); + acGrandChild2 = makeAccount(TQString("Grand Child 2"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); MyMoneyInstitution i("Bank of the World","","","","","",""); file->addInstitution(i); @@ -102,7 +102,7 @@ void PivotTableTest::testNetWorthSingle() { MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,1,1),QDate(2004,7,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2004,7,1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); writeTabletoCSV(networth_f); @@ -130,7 +130,7 @@ void PivotTableTest::testNetWorthOfsetting() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); CPPUNIT_ASSERT(networth_f.m_grid["Liability"]["Credit Card"][acCredit][eActual][7]==-moCreditOpen); @@ -146,7 +146,7 @@ void PivotTableTest::testNetWorthOpeningPrior() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2005,8,1),QDate(2005,12,31)); + filter.setDateFilter(TQDate(2005,8,1),TQDate(2005,12,31)); filter.setName("Net Worth Opening Prior 1"); XMLandback(filter); PivotTable networth_f( filter ); @@ -160,9 +160,9 @@ void PivotTableTest::testNetWorthOpeningPrior() // Test the net worth report to make sure that transactions prior to the report // period are included in the opening balance - TransactionHelper t1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acChecking, acChild ); + TransactionHelper t1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acChecking, acChild ); filter.setName("Net Worth Opening Prior 2"); PivotTable networth_f2( filter ); @@ -179,7 +179,7 @@ void PivotTableTest::testNetWorthDateFilter() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,1,1),QDate(2004,2,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2004,2,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); CPPUNIT_ASSERT(networth_f.m_grid.m_total[eActual][1]==moZero); @@ -196,7 +196,7 @@ void PivotTableTest::testSpendingEmpty() PivotTable spending_f1( filter ); CPPUNIT_ASSERT(spending_f1.m_grid.m_total[eActual].m_total==moZero); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); PivotTable spending_f2( filter ); CPPUNIT_ASSERT(spending_f2.m_grid.m_total[eActual].m_total==moZero); } @@ -204,11 +204,11 @@ void PivotTableTest::testSpendingEmpty() void PivotTableTest::testSingleTransaction() { // Test a single transaction - TransactionHelper t( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal,moSolo, acChecking, acSolo ); + TransactionHelper t( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal,moSolo, acChecking, acSolo ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.setName("Spending with Single Transaction.html"); XMLandback(filter); PivotTable spending_f( filter ); @@ -222,7 +222,7 @@ void PivotTableTest::testSingleTransaction() filter.clear(); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); CPPUNIT_ASSERT(networth_f.m_grid["Asset"]["Checking Account"].m_total[eActual][2]==(moCheckingOpen-moSolo) ); @@ -232,13 +232,13 @@ void PivotTableTest::testSubAccount() { // Test a sub-account with a value, under an account with a value - TransactionHelper t1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.setDetailLevel(MyMoneyReport::eDetailAll); filter.setName("Spending with Sub-Account"); XMLandback(filter); @@ -255,7 +255,7 @@ void PivotTableTest::testSubAccount() filter.clear(); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.setName("Net Worth with Sub-Account"); XMLandback(filter); PivotTable networth_f( filter ); @@ -268,13 +268,13 @@ void PivotTableTest::testSubAccount() void PivotTableTest::testFilterIEvsIE() { // Test that removing an income/spending account will remove the entry from an income/spending report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addCategory(acChild); filter.addCategory(acSolo); XMLandback(filter); @@ -289,13 +289,13 @@ void PivotTableTest::testFilterIEvsIE() void PivotTableTest::testFilterALvsAL() { // Test that removing an asset/liability account will remove the entry from an asset/liability report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addAccount(acChecking); filter.addCategory(acChild); filter.addCategory(acSolo); @@ -307,13 +307,13 @@ void PivotTableTest::testFilterALvsAL() void PivotTableTest::testFilterALvsIE() { // Test that removing an asset/liability account will remove the entry from an income/spending report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addAccount(acChecking); CPPUNIT_ASSERT(file->transactionList(filter).count() == 1); @@ -329,13 +329,13 @@ void PivotTableTest::testFilterAllvsIE() { // Test that removing an asset/liability account AND an income/expense // category will remove the entry from an income/spending report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addAccount(acCredit); filter.addCategory(acChild); PivotTable spending_f( filter ); @@ -348,14 +348,14 @@ void PivotTableTest::testFilterAllvsIE() void PivotTableTest::testFilterBasics() { // Test that the filters are operating the way that the reports expect them to - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyTransactionFilter filter; filter.clear(); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addCategory(acSolo); filter.setReportAllSplits(false); filter.setConsiderCategory(true); @@ -371,7 +371,7 @@ void PivotTableTest::testFilterBasics() CPPUNIT_ASSERT(file->transactionList(filter).count() == 1); filter.clear(); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addCategory(acParent); filter.addAccount(acCredit); filter.setReportAllSplits(false); @@ -392,26 +392,26 @@ void PivotTableTest::testMultipleCurrencies() MyMoneyMoney moCanTransaction( 100.0 ); MyMoneyMoney moJpyTransaction( 100.0 ); - QString acCanChecking = makeAccount(QString("Canadian Checking"),MyMoneyAccount::Checkings,moCanOpening,QDate(2003,11,15),acAsset,"CAD"); - QString acJpyChecking = makeAccount(QString("Japanese Checking"),MyMoneyAccount::Checkings,moJpyOpening,QDate(2003,11,15),acAsset,"JPY"); - QString acCanCash = makeAccount(QString("Canadian"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acForeign,"CAD"); - QString acJpyCash = makeAccount(QString("Japanese"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acForeign,"JPY"); + TQString acCanChecking = makeAccount(TQString("Canadian Checking"),MyMoneyAccount::Checkings,moCanOpening,TQDate(2003,11,15),acAsset,"CAD"); + TQString acJpyChecking = makeAccount(TQString("Japanese Checking"),MyMoneyAccount::Checkings,moJpyOpening,TQDate(2003,11,15),acAsset,"JPY"); + TQString acCanCash = makeAccount(TQString("Canadian"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acForeign,"CAD"); + TQString acJpyCash = makeAccount(TQString("Japanese"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acForeign,"JPY"); - makePrice("CAD",QDate(2004,1,1),MyMoneyMoney(moCanPrice)); - makePrice("JPY",QDate(2004,1,1),MyMoneyMoney(moJpyPrice)); - makePrice("JPY",QDate(2004,5,1),MyMoneyMoney(moJpyPrice2)); - makePrice("JPY",QDate(2004,6,30),MyMoneyMoney(moJpyPrice3)); - makePrice("JPY",QDate(2004,7,15),MyMoneyMoney(moJpyPrice4)); + makePrice("CAD",TQDate(2004,1,1),MyMoneyMoney(moCanPrice)); + makePrice("JPY",TQDate(2004,1,1),MyMoneyMoney(moJpyPrice)); + makePrice("JPY",TQDate(2004,5,1),MyMoneyMoney(moJpyPrice2)); + makePrice("JPY",TQDate(2004,6,30),MyMoneyMoney(moJpyPrice3)); + makePrice("JPY",TQDate(2004,7,15),MyMoneyMoney(moJpyPrice4)); - TransactionHelper t1( QDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); - TransactionHelper t2( QDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); - TransactionHelper t3( QDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); - TransactionHelper t4( QDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); - TransactionHelper t5( QDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); - TransactionHelper t6( QDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); + TransactionHelper t1( TQDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); + TransactionHelper t2( TQDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); + TransactionHelper t3( TQDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); + TransactionHelper t4( TQDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); + TransactionHelper t5( TQDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); + TransactionHelper t6( TQDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); #if 0 - QFile g( "multicurrencykmy.xml" ); + TQFile g( "multicurrencykmy.xml" ); g.open( IO_WriteOnly ); MyMoneyStorageXML xml; IMyMoneyStorageFormat& interface = xml; @@ -421,7 +421,7 @@ void PivotTableTest::testMultipleCurrencies() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.setDetailLevel(MyMoneyReport::eDetailAll); filter.setConvertCurrency(true); filter.setName("Multiple Currency Spending Rerport (with currency conversion)"); @@ -436,7 +436,7 @@ void PivotTableTest::testMultipleCurrencies() CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acCanCash][eActual][3]==(moCanTransaction*moCanPrice)); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acCanCash][eActual][4]==(moCanTransaction*moCanPrice)); - // test multiple foreign currencies under a common parent + // test multiple foreign currencies under a common tqparent CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acJpyCash][eActual][2]==(moJpyTransaction*moJpyPrice)); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acJpyCash][eActual][3]==(moJpyTransaction*moJpyPrice)); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acJpyCash][eActual][4]==(moJpyTransaction*moJpyPrice)); @@ -462,7 +462,7 @@ void PivotTableTest::testMultipleCurrencies() filter.clear(); filter.setName("Multiple currency net worth"); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); writeTabletoCSV(networth_f); @@ -497,12 +497,12 @@ void PivotTableTest::testAdvancedFilter() // amount { - TransactionHelper t1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.setAmountFilter(moChild,moChild); XMLandback(filter); PivotTable spending_f( filter ); @@ -511,14 +511,14 @@ void PivotTableTest::testAdvancedFilter() // payee (specific) { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart" ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, TQString(), "Thomas Baumgart" ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.addPayee(MyMoneyFile::instance()->payeeByName("Thomas Baumgart").id()); filter.setName("Spending with Payee Filter"); XMLandback(filter); @@ -530,15 +530,15 @@ void PivotTableTest::testAdvancedFilter() } // payee (no payee) { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moNoPayee, acCredit, acParent, QString(), QString() ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moNoPayee, acCredit, acParent, TQString(), TQString() ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); - filter.addPayee(QString()); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); + filter.addPayee(TQString()); XMLandback(filter); PivotTable spending_f( filter ); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Parent"][acParent][eActual][11]==moNoPayee); @@ -547,24 +547,24 @@ void PivotTableTest::testAdvancedFilter() // text { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart" ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, TQString(), "Thomas Baumgart" ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); - filter.setTextFilter(QRegExp("Thomas")); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); + filter.setTextFilter(TQRegExp("Thomas")); XMLandback(filter); PivotTable spending_f( filter ); } // type (payment, deposit, transfer) { - TransactionHelper t1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,2,1), MyMoneySplit::ActionDeposit, -moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,1), MyMoneySplit::ActionTransfer, moChild, acCredit, acChecking ); + TransactionHelper t1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,2,1), MyMoneySplit::ActionDeposit, -moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,1), MyMoneySplit::ActionTransfer, moChild, acCredit, acChecking ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); @@ -589,7 +589,7 @@ void PivotTableTest::testAdvancedFilter() CPPUNIT_ASSERT(spending_f3.m_grid.m_total[eActual].m_total == moZero); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter( QDate(2004,1,1), QDate(2004,12,31) ); + filter.setDateFilter( TQDate(2004,1,1), TQDate(2004,12,31) ); XMLandback(filter); PivotTable networth_f4( filter ); @@ -601,12 +601,12 @@ void PivotTableTest::testAdvancedFilter() // state (reconciled, cleared, not) { - TransactionHelper t1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - QValueList<MyMoneySplit> splits = t1.splits(); + TQValueList<MyMoneySplit> splits = t1.splits(); splits[0].setReconcileFlag(MyMoneySplit::Cleared); splits[1].setReconcileFlag(MyMoneySplit::Cleared); t1.modifySplit(splits[0]); @@ -623,7 +623,7 @@ void PivotTableTest::testAdvancedFilter() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.addState(MyMoneyTransactionFilter::cleared); XMLandback(filter); PivotTable spending_f( filter ); @@ -646,12 +646,12 @@ void PivotTableTest::testAdvancedFilter() // number { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - QValueList<MyMoneySplit> splits = t1.splits(); + TQValueList<MyMoneySplit> splits = t1.splits(); splits[0].setNumber("1"); splits[1].setNumber("1"); t1.modifySplit(splits[0]); @@ -684,7 +684,7 @@ void PivotTableTest::testAdvancedFilter() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.setNumberFilter("1","3"); XMLandback(filter); PivotTable spending_f( filter ); @@ -693,21 +693,21 @@ void PivotTableTest::testAdvancedFilter() // blank dates { - TransactionHelper t1y1( QDate(2003,10,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y1( QDate(2003,11,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y1( QDate(2003,12,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y1( TQDate(2003,10,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y1( TQDate(2003,11,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y1( TQDate(2003,12,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1y2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1y3( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y3( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y3( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y3( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y3( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y3( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(),QDate(2004,7,1)); + filter.setDateFilter(TQDate(),TQDate(2004,7,1)); XMLandback(filter); PivotTable spending_f( filter ); CPPUNIT_ASSERT(spending_f.m_grid.m_total[eActual].m_total==-moSolo-moParent1-moParent2-moSolo-moParent1-moParent2); @@ -725,21 +725,21 @@ void PivotTableTest::testColumnType() { // test column type values of other than 'month' - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q1( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q1( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1q2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1q2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1y2( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y2( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2003,12,31),QDate(2005,12,31)); + filter.setDateFilter(TQDate(2003,12,31),TQDate(2005,12,31)); filter.setRowType( MyMoneyReport::eExpenseIncome ); filter.setColumnType(MyMoneyReport::eBiMonths); XMLandback(filter); @@ -809,19 +809,19 @@ void PivotTableTest::testColumnType() // Test days-based reports - TransactionHelper t1d1( QDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2d1( QDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3d1( QDate(2004,7,5), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1d1( TQDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2d1( TQDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3d1( TQDate(2004,7,5), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1d2( QDate(2004,7,14), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2d2( QDate(2004,7,15), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3d2( QDate(2004,7,20), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1d2( TQDate(2004,7,14), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2d2( TQDate(2004,7,15), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3d2( TQDate(2004,7,20), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1d3( QDate(2004,8,2), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2d3( QDate(2004,8,3), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3d3( QDate(2004,8,4), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1d3( TQDate(2004,8,2), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2d3( TQDate(2004,8,3), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3d3( TQDate(2004,8,4), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - filter.setDateFilter(QDate(2004,7,2),QDate(2004,7,14)); + filter.setDateFilter(TQDate(2004,7,2),TQDate(2004,7,14)); filter.setRowType( MyMoneyReport::eExpenseIncome ); filter.setColumnType(MyMoneyReport::eMonths); filter.setColumnsAreDays(true); @@ -837,7 +837,7 @@ void PivotTableTest::testColumnType() unsigned save_dayweekstart = KGlobal::locale()->weekStartDay(); KGlobal::locale()->setWeekStartDay(2); - filter.setDateFilter(QDate(2004,7,2),QDate(2004,8,1)); + filter.setDateFilter(TQDate(2004,7,2),TQDate(2004,8,1)); filter.setRowType( MyMoneyReport::eExpenseIncome ); filter.setColumnType(static_cast<MyMoneyReport::EColumnType>(7)); filter.setColumnsAreDays(true); @@ -868,23 +868,23 @@ void PivotTableTest::testInvestment(void) eqStock2 = makeEquity("Stock2","STK2"); // Accounts - acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,QDate(2004,1,1),acAsset); - acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock1); - acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock2); - acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,QDate(2004,1,1),acIncome); + acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,TQDate(2004,1,1),acAsset); + acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock1); + acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock2); + acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,TQDate(2004,1,1),acIncome); // Transactions // Date Action Shares Price Stock Asset Income - InvTransactionHelper s1b1( QDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1b2( QDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s1( QDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s2( QDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1r1( QDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1r2( QDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1c1( QDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); - InvTransactionHelper s1c2( QDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1b1( TQDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1b2( TQDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s1( TQDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s2( TQDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1r1( TQDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1r2( TQDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1c1( TQDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1c2( TQDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); - makeEquityPrice( eqStock1, QDate(2004,10,1), 100.00 ); + makeEquityPrice( eqStock1, TQDate(2004,10,1), 100.00 ); // // Net Worth Report (with investments) @@ -892,7 +892,7 @@ void PivotTableTest::testInvestment(void) MyMoneyReport networth_r; networth_r.setRowType( MyMoneyReport::eAssetLiability ); - networth_r.setDateFilter(QDate(2004,1,1),QDate(2004,12,31).addDays(-1)); + networth_r.setDateFilter(TQDate(2004,1,1),TQDate(2004,12,31).addDays(-1)); XMLandback(networth_r); PivotTable networth(networth_r); @@ -920,7 +920,7 @@ void PivotTableTest::testInvestment(void) #if 0 // Dump file & reports - QFile g( "investmentkmy.xml" ); + TQFile g( "investmentkmy.xml" ); g.open( IO_WriteOnly ); MyMoneyStorageXML xml; IMyMoneyStorageFormat& interface = xml; @@ -945,7 +945,7 @@ void PivotTableTest::testBudget(void) // 1. Budget on A, transations on A { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acSolo, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acSolo, false, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, @@ -958,7 +958,7 @@ void PivotTableTest::testBudget(void) // 2. Budget on B, not applying to sub accounts, transactions on B and B:1 { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acParent, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acParent, false, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, @@ -974,7 +974,7 @@ void PivotTableTest::testBudget(void) // 3. Budget on C, applying to sub accounts, transactions on C and C:1 and C:1:a { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acParent, true, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acParent, true, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, @@ -989,9 +989,9 @@ void PivotTableTest::testBudget(void) // 4. Budget on D, not applying to sub accounts, budget on D:1 not applying, budget on D:2 applying. Transactions on D, D:1, D:2, D:2:a, D:2:b { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acParent, false, 100.0 ); - budget += BudgetEntryHelper( QDate(2006,1,1), acChild, false, 100.0 ); - budget += BudgetEntryHelper( QDate(2006,1,1), acSecondChild, true, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acParent, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acChild, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acSecondChild, true, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, @@ -1003,12 +1003,12 @@ void PivotTableTest::testBudget(void) // - Totals for D, D:1, D:2 show up. D:2:a and D:2:b do not // - D actuals (only) compare against D budget // - Ditto for D:1 - // - D:2 acutals and children compare against D:2 budget + // - D:2 acutals and tqchildren compare against D:2 budget // 5. Budget on E, no transactions on E { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acSolo, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acSolo, false, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, |