summaryrefslogtreecommitdiffstats
path: root/kmymoney2/reports/querytabletest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/reports/querytabletest.cpp')
-rw-r--r--kmymoney2/reports/querytabletest.cpp212
1 files changed, 106 insertions, 106 deletions
diff --git a/kmymoney2/reports/querytabletest.cpp b/kmymoney2/reports/querytabletest.cpp
index 8b3c579..73ab69d 100644
--- a/kmymoney2/reports/querytabletest.cpp
+++ b/kmymoney2/reports/querytabletest.cpp
@@ -15,9 +15,9 @@
* *
***************************************************************************/
-#include <qvaluelist.h>
-#include <qvaluevector.h>
-#include <qfile.h>
+#include <tqvaluelist.h>
+#include <tqvaluevector.h>
+#include <tqfile.h>
#include <kdebug.h>
#include <kdeversion.h>
@@ -30,7 +30,7 @@
#include "reportstestcommon.h"
#define private public
-#include "querytable.h"
+#include "tquerytable.h"
#undef private
#include "../mymoney/mymoneyaccount.h"
@@ -56,7 +56,7 @@ void QueryTableTest::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"));
@@ -69,13 +69,13 @@ void QueryTableTest::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);
- acTax = makeAccount(QString("Tax"), MyMoneyAccount::Expense,0,QDate(2005,1,11),acExpense, "", true);
+ 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);
+ acTax = makeAccount(TQString("Tax"), MyMoneyAccount::Expense,0,TQDate(2005,1,11),acExpense, "", true);
MyMoneyInstitution i("Bank of the World","","","","","","");
file->addInstitution(i);
@@ -93,26 +93,26 @@ void QueryTableTest::testQueryBasics()
{
try
{
- 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 t4y1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
+ 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 t4y1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
- 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 t4q2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
+ 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 t4q2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
- 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 t4y2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
+ 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 );
+ TransactionHelper t4y2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
unsigned cols;
MyMoneyReport filter;
filter.setRowType( MyMoneyReport::eCategory );
- cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount;
+ cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCaccount;
filter.setQueryColumns( static_cast<MyMoneyReport::EQueryColumns>(cols) ); //
filter.setName("Transactions by Category");
XMLandback(filter);
@@ -120,7 +120,7 @@ void QueryTableTest::testQueryBasics()
writeTabletoHTML(qtbl_1,"Transactions by Category.html");
- QValueList<ListTable::TableRow> rows = qtbl_1.rows();
+ TQValueList<ListTable::TableRow> rows = qtbl_1.rows();
CPPUNIT_ASSERT(rows.count() == 12);
CPPUNIT_ASSERT(rows[0]["categorytype"]=="Expense");
@@ -130,14 +130,14 @@ void QueryTableTest::testQueryBasics()
CPPUNIT_ASSERT(rows[11]["category"]=="Solo");
CPPUNIT_ASSERT(rows[11]["postdate"]=="2005-01-01");
- QString html = qtbl_1.renderHTML();
+ TQString html = qtbl_1.renderHTML();
CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Parent") == -(moParent1 + moParent2) * 3 );
CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Parent: Child") == -(moChild) * 3 );
CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Solo") == -(moSolo) * 3 );
CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Expense") == -(moParent1 + moParent2 + moSolo + moChild) * 3 );
CPPUNIT_ASSERT( searchHTML(html,i18n("Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen );
filter.setRowType( MyMoneyReport::eTopCategory );
- cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount;
+ cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCaccount;
filter.setQueryColumns( static_cast<MyMoneyReport::EQueryColumns>(cols) ); //
filter.setName("Transactions by Top Category");
XMLandback(filter);
@@ -166,7 +166,7 @@ void QueryTableTest::testQueryBasics()
filter.setRowType( MyMoneyReport::eAccount );
filter.setName("Transactions by Account");
- cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory;
+ cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory;
filter.setQueryColumns( static_cast<MyMoneyReport::EQueryColumns>(cols) ); //
XMLandback(filter);
QueryTable qtbl_3(filter);
@@ -200,7 +200,7 @@ void QueryTableTest::testQueryBasics()
filter.setRowType( MyMoneyReport::ePayee );
filter.setName("Transactions by Payee");
- cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCmemo | MyMoneyReport::eQCcategory;
+ cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCmemo | MyMoneyReport::eTQCcategory;
filter.setQueryColumns( static_cast<MyMoneyReport::EQueryColumns>(cols) ); //
XMLandback(filter);
QueryTable qtbl_4(filter);
@@ -226,7 +226,7 @@ void QueryTableTest::testQueryBasics()
filter.setRowType( MyMoneyReport::eMonth );
filter.setName("Transactions by Month");
- cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory;
+ cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory;
filter.setQueryColumns( static_cast<MyMoneyReport::EQueryColumns>(cols) ); //
XMLandback(filter);
QueryTable qtbl_5(filter);
@@ -254,7 +254,7 @@ void QueryTableTest::testQueryBasics()
filter.setRowType( MyMoneyReport::eWeek );
filter.setName("Transactions by Week");
- cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory;
+ cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory;
filter.setQueryColumns( static_cast<MyMoneyReport::EQueryColumns>(cols) ); //
XMLandback(filter);
QueryTable qtbl_6(filter);
@@ -311,23 +311,23 @@ void QueryTableTest::testCashFlowAnalysis()
CashFlowList list;
- list += CashFlowListItem( QDate(2004,5,3),1000.0 );
- list += CashFlowListItem( QDate(2004,5,20),59.0 );
- list += CashFlowListItem( QDate(2004,6,3),14.0 );
- list += CashFlowListItem( QDate(2004,6,24),92.0 );
- list += CashFlowListItem( QDate(2004,7,6),63.0 );
- list += CashFlowListItem( QDate(2004,7,25),15.0 );
- list += CashFlowListItem( QDate(2004,8,5),92.0 );
- list += CashFlowListItem( QDate(2004,9,2),18.0 );
- list += CashFlowListItem( QDate(2004,9,21),5.0 );
- list += CashFlowListItem( QDate(2004,10,16),-2037.0 );
+ list += CashFlowListItem( TQDate(2004,5,3),1000.0 );
+ list += CashFlowListItem( TQDate(2004,5,20),59.0 );
+ list += CashFlowListItem( TQDate(2004,6,3),14.0 );
+ list += CashFlowListItem( TQDate(2004,6,24),92.0 );
+ list += CashFlowListItem( TQDate(2004,7,6),63.0 );
+ list += CashFlowListItem( TQDate(2004,7,25),15.0 );
+ list += CashFlowListItem( TQDate(2004,8,5),92.0 );
+ list += CashFlowListItem( TQDate(2004,9,2),18.0 );
+ list += CashFlowListItem( TQDate(2004,9,21),5.0 );
+ list += CashFlowListItem( TQDate(2004,10,16),-2037.0 );
MyMoneyMoney IRR(list.IRR(),1000);
CPPUNIT_ASSERT( IRR == MyMoneyMoney(1676,1000) );
list.pop_back();
- list += CashFlowListItem( QDate(2004,10,16),-1358.0 );
+ list += CashFlowListItem( TQDate(2004,10,16),-1358.0 );
IRR = MyMoneyMoney( list.IRR(), 1000 );
@@ -338,7 +338,7 @@ void QueryTableTest::testAccountQuery()
{
try
{
- QString htmlcontext = QString("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"html/kmymoney2.css\"></head><body>\n%1\n</body></html>\n");
+ TQString htmlcontext = TQString("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"html/kmymoney2.css\"></head><body>\n%1\n</body></html>\n");
//
// No transactions, opening balances only
@@ -352,7 +352,7 @@ void QueryTableTest::testAccountQuery()
writeTabletoHTML(qtbl_1,"Accounts by Institution (No transactions).html");
- QValueList<ListTable::TableRow> rows = qtbl_1.rows();
+ TQValueList<ListTable::TableRow> rows = qtbl_1.rows();
CPPUNIT_ASSERT(rows.count() == 2);
CPPUNIT_ASSERT(rows[0]["account"]=="Checking Account");
@@ -362,7 +362,7 @@ void QueryTableTest::testAccountQuery()
CPPUNIT_ASSERT(MyMoneyMoney(rows[1]["value"])==moCreditOpen);
CPPUNIT_ASSERT(rows[1]["equitytype"].isEmpty());
- QString html = qtbl_1.renderHTML();
+ TQString html = qtbl_1.renderHTML();
CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" None") == moCheckingOpen+moCreditOpen );
CPPUNIT_ASSERT( searchHTML(html,i18n("Grand Total")) == moCheckingOpen+moCreditOpen );
@@ -370,20 +370,20 @@ void QueryTableTest::testAccountQuery()
// Adding in transactions
//
- 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 t4y1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
+ 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 t4y1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
- 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 t4q2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
+ 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 t4q2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
- 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 t4y2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
+ 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 );
+ TransactionHelper t4y2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
filter.setRowType( MyMoneyReport::eInstitution );
filter.setName("Accounts by Institution (With Transactions)");
@@ -439,25 +439,25 @@ void QueryTableTest::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);
- acInterest = makeAccount("Interest",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);
+ acInterest = makeAccount("Interest",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 s1y1( QDate(2004,9,15), MyMoneySplit::ActionYield, 10.00, 110.00, acStock1, acChecking, acInterest );
-
- makeEquityPrice( eqStock1, QDate(2004,10,1), 100.00 );
+ 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 );
+ InvTransactionHelper s1y1( TQDate(2004,9,15), MyMoneySplit::ActionYield, 10.00, 110.00, acStock1, acChecking, acInterest );
+
+ makeEquityPrice( eqStock1, TQDate(2004,10,1), 100.00 );
//
// Investment Transactions Report
@@ -465,13 +465,13 @@ void QueryTableTest::testInvestment(void)
MyMoneyReport invtran_r(
MyMoneyReport::eTopAccount,
- MyMoneyReport::eQCaction|MyMoneyReport::eQCshares|MyMoneyReport::eQCprice,
+ MyMoneyReport::eTQCaction|MyMoneyReport::eTQCshares|MyMoneyReport::eTQCprice,
MyMoneyTransactionFilter::userDefined,
MyMoneyReport::eDetailAll,
i18n("Investment Transactions"),
i18n("Test Report")
);
- invtran_r.setDateFilter(QDate(2004,1,1),QDate(2004,12,31));
+ invtran_r.setDateFilter(TQDate(2004,1,1),TQDate(2004,12,31));
invtran_r.setInvestmentsOnly(true);
XMLandback(invtran_r);
QueryTable invtran(invtran_r);
@@ -479,7 +479,7 @@ void QueryTableTest::testInvestment(void)
#if 1
writeTabletoHTML(invtran,"investment_transactions_test.html");
- QValueList<ListTable::TableRow> rows = invtran.rows();
+ TQValueList<ListTable::TableRow> rows = invtran.rows();
CPPUNIT_ASSERT(rows.count()==17);
CPPUNIT_ASSERT(MyMoneyMoney(rows[1]["value"])==MyMoneyMoney(100000.00));
@@ -541,7 +541,7 @@ void QueryTableTest::testInvestment(void)
CPPUNIT_ASSERT(rows[8]["action"]=="Yield");
#endif
- QString html = invtran.renderHTML();
+ TQString html = invtran.renderHTML();
#if 1
// i think this is the correct amount. different treatment of dividend and yield
CPPUNIT_ASSERT( searchHTML(html,i18n("Total Stock 1")) == MyMoneyMoney(175000.00) );
@@ -557,13 +557,13 @@ void QueryTableTest::testInvestment(void)
MyMoneyReport invhold_r(
MyMoneyReport::eAccountByTopAccount,
- MyMoneyReport::eQCperformance,
+ MyMoneyReport::eTQCperformance,
MyMoneyTransactionFilter::userDefined,
MyMoneyReport::eDetailAll,
i18n("Investment Performance by Account"),
i18n("Test Report")
);
- invhold_r.setDateFilter(QDate(2004,1,1),QDate(2004,10,1));
+ invhold_r.setDateFilter(TQDate(2004,1,1),TQDate(2004,10,1));
invhold_r.setInvestmentsOnly(true);
XMLandback(invhold_r);
QueryTable invhold(invhold_r);
@@ -587,7 +587,7 @@ void QueryTableTest::testInvestment(void)
#if 0
// Dump file & reports
- QFile g( "investmentkmy.xml" );
+ TQFile g( "investmentkmy.xml" );
g.open( IO_WriteOnly );
MyMoneyStorageXML xml;
IMyMoneyStorageFormat& interface = xml;
@@ -611,20 +611,20 @@ void QueryTableTest::testInvestment(void)
{
try
{
- 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 t4y1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
+ 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 t4y1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
- 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 t4q2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
+ 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 t4q2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
- 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 t4y2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
+ 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 );
+ TransactionHelper t4y2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild );
unsigned cols;
@@ -632,25 +632,25 @@ void QueryTableTest::testInvestment(void)
filter.setRowType( MyMoneyReport::eAccount );
filter.setName("Transactions by Account");
- cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance;
+ cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory | MyMoneyReport::eTQCbalance;
filter.setQueryColumns( static_cast<MyMoneyReport::EQueryColumns>(cols) ); //
XMLandback(filter);
QueryTable qtbl_3(filter);
writeTabletoHTML(qtbl_3,"Transactions by Account.html");
- QString html = qtbl_3.renderHTML();
+ TQString html = qtbl_3.renderHTML();
- QValueList<ListTable::TableRow> rows = qtbl_3.rows();
+ TQValueList<ListTable::TableRow> rows = qtbl_3.rows();
CPPUNIT_ASSERT(rows.count() == 16);
//this is to make sure that the dates of closing and opening balances and the balance numbers are ok
- QString openingDate = KGlobal::locale()->formatDate(QDate(2004,1,1), true);
- QString closingDate = KGlobal::locale()->formatDate(QDate(2005,9,1), true);
- CPPUNIT_ASSERT( html.find(openingDate + "</td><td class=\"left\"></td><td class=\"left\">"+i18n("Opening Balance")) > 0);
- CPPUNIT_ASSERT( html.find(closingDate + "</td><td class=\"left\"></td><td class=\"left\">"+i18n("Closing Balance")+"</td><td class=\"left\"></td><td class=\"value\"></td><td>&nbsp;-702.36</td></tr>") > 0);
- CPPUNIT_ASSERT( html.find(closingDate + "</td><td class=\"left\"></td><td class=\"left\">"+i18n("Closing Balance")+"</td><td class=\"left\"></td><td class=\"value\"></td><td>&nbsp;-705.69</td></tr>") > 0);
+ TQString openingDate = KGlobal::locale()->formatDate(TQDate(2004,1,1), true);
+ TQString closingDate = KGlobal::locale()->formatDate(TQDate(2005,9,1), true);
+ CPPUNIT_ASSERT( html.tqfind(openingDate + "</td><td class=\"left\"></td><td class=\"left\">"+i18n("Opening Balance")) > 0);
+ CPPUNIT_ASSERT( html.tqfind(closingDate + "</td><td class=\"left\"></td><td class=\"left\">"+i18n("Closing Balance")+"</td><td class=\"left\"></td><td class=\"value\"></td><td>&nbsp;-702.36</td></tr>") > 0);
+ CPPUNIT_ASSERT( html.tqfind(closingDate + "</td><td class=\"left\"></td><td class=\"left\">"+i18n("Closing Balance")+"</td><td class=\"left\"></td><td class=\"value\"></td><td>&nbsp;-705.69</td></tr>") > 0);
}
catch(MyMoneyException *e)
@@ -664,15 +664,15 @@ void QueryTableTest::testInvestment(void)
void QueryTableTest::testTaxReport()
{
try {
- TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo );
- TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acChecking, acTax );
+ TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo );
+ TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acChecking, acTax );
unsigned cols;
MyMoneyReport filter;
filter.setRowType( MyMoneyReport::eCategory );
filter.setName("Tax Transactions");
- cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount;
+ cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCaccount;
filter.setQueryColumns( static_cast<MyMoneyReport::EQueryColumns>(cols) );
filter.setTax(true);
@@ -681,9 +681,9 @@ void QueryTableTest::testTaxReport()
writeTabletoHTML(qtbl_3,"Tax Transactions.html");
- QValueList<ListTable::TableRow> rows = qtbl_3.rows();
+ TQValueList<ListTable::TableRow> rows = qtbl_3.rows();
- QString html = qtbl_3.renderHTML();
+ TQString html = qtbl_3.renderHTML();
CPPUNIT_ASSERT(rows.count() == 1);
} catch(MyMoneyException *e) {
CPPUNIT_FAIL(e->what());