summaryrefslogtreecommitdiffstats
path: root/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-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/plugins/ofximport/dialogs/mymoneyofxconnector.cpp')
-rw-r--r--kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp220
1 files changed, 110 insertions, 110 deletions
diff --git a/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp b/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp
index 6e841bb..71897d2 100644
--- a/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp
+++ b/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp
@@ -27,8 +27,8 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qdatetime.h>
-#include <qregexp.h>
+#include <tqdatetime.h>
+#include <tqregexp.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -46,7 +46,7 @@
#include <kmymoney/mymoneykeyvaluecontainer.h>
#include "mymoneyofxconnector.h"
-OfxHeaderVersion::OfxHeaderVersion(KComboBox* combo, const QString& headerVersion) :
+OfxHeaderVersion::OfxHeaderVersion(KComboBox* combo, const TQString& headerVersion) :
m_combo(combo)
{
combo->clear();
@@ -66,24 +66,24 @@ OfxHeaderVersion::OfxHeaderVersion(KComboBox* combo, const QString& headerVersio
#endif
}
-QString OfxHeaderVersion::headerVersion(void) const
+TQString OfxHeaderVersion::headerVersion(void) const
{
return m_combo->currentText();
}
-OfxAppVersion::OfxAppVersion(KComboBox* combo, const QString& appId) :
+OfxAppVersion::OfxAppVersion(KComboBox* combo, const TQString& appId) :
m_combo(combo)
{
// http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-intuit-products/
// http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-microsoft-money/
// Quicken
- m_appMap[i18n("Quicken Windows 2003")] = "QWIN:1200";
- m_appMap[i18n("Quicken Windows 2004")] = "QWIN:1300";
- m_appMap[i18n("Quicken Windows 2005")] = "QWIN:1400";
- m_appMap[i18n("Quicken Windows 2006")] = "QWIN:1500";
- m_appMap[i18n("Quicken Windows 2007")] = "QWIN:1600";
- m_appMap[i18n("Quicken Windows 2008")] = "QWIN:1700";
+ m_appMap[i18n("Quicken Windows 2003")] = "TQWIN:1200";
+ m_appMap[i18n("Quicken Windows 2004")] = "TQWIN:1300";
+ m_appMap[i18n("Quicken Windows 2005")] = "TQWIN:1400";
+ m_appMap[i18n("Quicken Windows 2006")] = "TQWIN:1500";
+ m_appMap[i18n("Quicken Windows 2007")] = "TQWIN:1600";
+ m_appMap[i18n("Quicken Windows 2008")] = "TQWIN:1700";
// MS-Money
m_appMap[i18n("MS-Money 2003")] = "Money:1100";
@@ -99,7 +99,7 @@ OfxAppVersion::OfxAppVersion(KComboBox* combo, const QString& appId) :
combo->clear();
combo->insertStringList(m_appMap.keys());
- QMap<QString, QString>::const_iterator it_a;
+ TQMap<TQString, TQString>::const_iterator it_a;
for(it_a = m_appMap.begin(); it_a != m_appMap.end(); ++it_a) {
if(*it_a == appId)
break;
@@ -118,14 +118,14 @@ OfxAppVersion::OfxAppVersion(KComboBox* combo, const QString& appId) :
#endif
}
-const QString& OfxAppVersion::appId(void) const
+const TQString& OfxAppVersion::appId(void) const
{
- static QString defaultAppId("QWIN:1700");
+ static TQString defaultAppId("TQWIN:1700");
- QString app = m_combo->currentText();
+ TQString app = m_combo->currentText();
if(m_appMap[app] != defaultAppId)
return m_appMap[app];
- return QString::null;
+ return TQString();
}
MyMoneyOfxConnector::MyMoneyOfxConnector(const MyMoneyAccount& _account):
@@ -134,28 +134,28 @@ MyMoneyOfxConnector::MyMoneyOfxConnector(const MyMoneyAccount& _account):
m_fiSettings = m_account.onlineBankingSettings();
}
-QString MyMoneyOfxConnector::iban(void) const { return m_fiSettings.value("bankid"); }
-QString MyMoneyOfxConnector::fiorg(void) const { return m_fiSettings.value("org"); }
-QString MyMoneyOfxConnector::fiid(void) const { return m_fiSettings.value("fid"); }
-QString MyMoneyOfxConnector::username(void) const { return m_fiSettings.value("username"); }
-QString MyMoneyOfxConnector::password(void) const { return m_fiSettings.value("password"); }
-QString MyMoneyOfxConnector::accountnum(void) const { return m_fiSettings.value("accountid"); }
-QString MyMoneyOfxConnector::url(void) const { return m_fiSettings.value("url"); }
+TQString MyMoneyOfxConnector::iban(void) const { return m_fiSettings.value("bankid"); }
+TQString MyMoneyOfxConnector::fiorg(void) const { return m_fiSettings.value("org"); }
+TQString MyMoneyOfxConnector::fiid(void) const { return m_fiSettings.value("fid"); }
+TQString MyMoneyOfxConnector::username(void) const { return m_fiSettings.value("username"); }
+TQString MyMoneyOfxConnector::password(void) const { return m_fiSettings.value("password"); }
+TQString MyMoneyOfxConnector::accountnum(void) const { return m_fiSettings.value("accountid"); }
+TQString MyMoneyOfxConnector::url(void) const { return m_fiSettings.value("url"); }
-QDate MyMoneyOfxConnector::statementStartDate(void) const {
+TQDate MyMoneyOfxConnector::statementStartDate(void) const {
if ((m_fiSettings.value("kmmofx-todayMinus").toInt() != 0) && !m_fiSettings.value("kmmofx-numRequestDays").isEmpty())
{
- return QDate::currentDate().addDays(-m_fiSettings.value("kmmofx-numRequestDays").toInt());
+ return TQDate::tqcurrentDate().addDays(-m_fiSettings.value("kmmofx-numRequestDays").toInt());
}
else if ((m_fiSettings.value("kmmofx-lastUpdate").toInt() != 0) && !m_account.value("lastImportedTransactionDate").isEmpty())
{
- return QDate::fromString(m_account.value("lastImportedTransactionDate"), Qt::ISODate);
+ return TQDate::fromString(m_account.value("lastImportedTransactionDate"), Qt::ISODate);
}
else if ((m_fiSettings.value("kmmofx-pickDate").toInt() != 0) && !m_fiSettings.value("kmmofx-specificDate").isEmpty())
{
- return QDate::fromString(m_fiSettings.value("kmmofx-specificDate"));
+ return TQDate::fromString(m_fiSettings.value("kmmofx-specificDate"));
}
- return QDate::currentDate().addMonths(-2);
+ return TQDate::tqcurrentDate().addMonths(-2);
}
#if LIBOFX_IS_VERSION(0,9,0)
@@ -163,7 +163,7 @@ OfxAccountData::AccountType MyMoneyOfxConnector::accounttype(void) const
{
OfxAccountData::AccountType result = OfxAccountData::OFX_CHECKING;
- QString type = m_account.onlineBankingSettings()["type"];
+ TQString type = m_account.onlineBankingSettings()["type"];
if(type == "CHECKING")
result = OfxAccountData::OFX_CHECKING;
else if(type == "SAVINGS")
@@ -197,10 +197,10 @@ OfxAccountData::AccountType MyMoneyOfxConnector::accounttype(void) const
// This is a bit of a personalized hack. Sometimes we may want to override the
// ofx type for an account. For now, I will stash it in the notes!
- QRegExp rexp("OFXTYPE:([A-Z]*)");
+ TQRegExp rexp("OFXTYPE:([A-Z]*)");
if ( rexp.search(m_account.description()) != -1 )
{
- QString override = rexp.cap(1);
+ TQString override = rexp.cap(1);
kdDebug(2) << "MyMoneyOfxConnector::accounttype() overriding to " << result << endl;
if ( override == "BANK" )
@@ -235,10 +235,10 @@ AccountType MyMoneyOfxConnector::accounttype(void) const
// This is a bit of a personalized hack. Sometimes we may want to override the
// ofx type for an account. For now, I will stash it in the notes!
- QRegExp rexp("OFXTYPE:([A-Z]*)");
+ TQRegExp rexp("OFXTYPE:([A-Z]*)");
if ( rexp.search(m_account.description()) != -1 )
{
- QString override = rexp.cap(1);
+ TQString override = rexp.cap(1);
kdDebug(2) << "MyMoneyOfxConnector::accounttype() overriding to " << result << endl;
if ( override == "BANK" )
@@ -269,24 +269,24 @@ void MyMoneyOfxConnector::initRequest(OfxFiLogin* fi) const
// If we don't know better, we pretend to be Quicken 2008
// http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-intuit-products/
// http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-microsoft-money/
- QString appId = m_account.onlineBankingSettings().value("appId");
- QRegExp exp("(.*):(.*)");
+ TQString appId = m_account.onlineBankingSettings().value("appId");
+ TQRegExp exp("(.*):(.*)");
if(exp.search(appId) != -1) {
strncpy(fi->appid, exp.cap(1).latin1(), OFX_APPID_LENGTH-1);
strncpy(fi->appver, exp.cap(2).latin1(), OFX_APPVER_LENGTH-1);
} else {
- strncpy(fi->appid, "QWIN", OFX_APPID_LENGTH-1);
+ strncpy(fi->appid, "TQWIN", OFX_APPID_LENGTH-1);
strncpy(fi->appver, "1700", OFX_APPVER_LENGTH-1);
}
- QString headerVersion = m_account.onlineBankingSettings().value("kmmofx-headerVersion");
+ TQString headerVersion = m_account.onlineBankingSettings().value("kmmofx-headerVersion");
if(!headerVersion.isEmpty()) {
strncpy(fi->header_version, headerVersion.latin1(), OFX_HEADERVERSION_LENGTH-1);
}
#endif
}
-const QByteArray MyMoneyOfxConnector::statementRequest(void) const
+const TQByteArray MyMoneyOfxConnector::statementRequest(void) const
{
OfxFiLogin fi;
initRequest(&fi);
@@ -313,29 +313,29 @@ const QByteArray MyMoneyOfxConnector::statementRequest(void) const
account.type = accounttype();
#endif
- char* szrequest = libofx_request_statement( &fi, &account, QDateTime(statementStartDate()).toTime_t() );
- QString request = szrequest;
+ char* szrequest = libofx_request_statement( &fi, &account, TQDateTime(statementStartDate()).toTime_t() );
+ TQString request = szrequest;
// remove the trailing zero
- QByteArray result = request.utf8();
+ TQByteArray result = request.utf8();
result.truncate(result.size()-1);
free(szrequest);
- QString msg(result);
+ TQString msg(result);
return result;
}
#if 0
// this code is not used anymore. The logic is now
// contained in KOnlineBankingSetupWizard::finishLoginPage(void)
-const QByteArray MyMoneyOfxConnector::accountInfoRequest(void) const
+const TQByteArray MyMoneyOfxConnector::accountInfoRequest(void) const
{
OfxFiLogin fi;
initRequest(&fi);
char* szrequest = libofx_request_accountinfo( &fi );
- QString request = szrequest;
+ TQString request = szrequest;
// remove the trailing zero
- QByteArray result = request.utf8();
+ TQByteArray result = request.utf8();
result.truncate(result.size()-1);
free(szrequest);
@@ -345,7 +345,7 @@ const QByteArray MyMoneyOfxConnector::accountInfoRequest(void) const
#if 0
-MyMoneyOfxConnector::Tag MyMoneyOfxConnector::message(const QString& _msgType, const QString& _trnType, const Tag& _request)
+MyMoneyOfxConnector::Tag MyMoneyOfxConnector::message(const TQString& _msgType, const TQString& _trnType, const Tag& _request)
{
return Tag(_msgType+"MSGSRQV1")
.subtag(Tag(_trnType+"TRNRQ")
@@ -356,8 +356,8 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::message(const QString& _msgType, c
MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentRequest(void) const
{
- QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
- QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
+ TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
+ TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
return message("INVSTMT","INVSTMT",Tag("INVSTMTRQ")
.subtag(Tag("INVACCTFROM").element("BROKERID", fiorg()).element("ACCTID", accountnum()))
@@ -367,18 +367,18 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentRequest(void) const
.element("INCBAL","Y"));
}
-MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementRequest(const QDate& _dtstart) const
+MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementRequest(const TQDate& _dtstart) const
{
- QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
+ TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
return message("BANK","STMT",Tag("STMTRQ")
.subtag(Tag("BANKACCTFROM").element("BANKID", iban()).element("ACCTID", accountnum()).element("ACCTTYPE", "CHECKING"))
.subtag(Tag("INCTRAN").element("DTSTART",dtstart_string).element("INCLUDE","Y")));
}
-MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardRequest(const QDate& _dtstart) const
+MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardRequest(const TQDate& _dtstart) const
{
- QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
+ TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
return message("CREDITCARD","CCSTMT",Tag("CCSTMTRQ")
.subtag(Tag("CCACCTFROM").element("ACCTID",accountnum()))
@@ -387,7 +387,7 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardRequest(const QDate& _dt
MyMoneyOfxConnector::Tag MyMoneyOfxConnector::signOn(void) const
{
- QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
+ TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
Tag fi("FI");
fi.element("ORG",fiorg());
@@ -401,13 +401,13 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::signOn(void) const
.element("USERPASS",password())
.element("LANGUAGE","ENG")
.subtag(fi)
- .element("APPID","QWIN")
+ .element("APPID","TQWIN")
.element("APPVER","1100"));
}
-QString MyMoneyOfxConnector::header(void)
+TQString MyMoneyOfxConnector::header(void)
{
- return QString("OFXHEADER:100\r\n"
+ return TQString("OFXHEADER:100\r\n"
"DATA:OFXSGML\r\n"
"VERSION:102\r\n"
"SECURITY:NONE\r\n"
@@ -416,13 +416,13 @@ QString MyMoneyOfxConnector::header(void)
"COMPRESSION:NONE\r\n"
"OLDFILEUID:NONE\r\n"
"NEWFILEUID:%1\r\n"
- "\r\n").arg(uuid());
+ "\r\n").tqarg(uuid());
}
-QString MyMoneyOfxConnector::uuid(void)
+TQString MyMoneyOfxConnector::uuid(void)
{
static int id = 1;
- return QDateTime::currentDateTime().toString("yyyyMMdd-hhmmsszzz-") + QString::number(id++);
+ return TQDateTime::tqcurrentDateTime().toString("yyyyMMdd-hhmmsszzz-") + TQString::number(id++);
}
//
@@ -436,9 +436,9 @@ QString MyMoneyOfxConnector::uuid(void)
// the open source software community.
//
-const QByteArray MyMoneyOfxConnector::statementResponse(const QDate& _dtstart) const
+const TQByteArray MyMoneyOfxConnector::statementResponse(const TQDate& _dtstart) const
{
- QString request;
+ TQString request;
if ( accounttype()=="CC" )
request = header() + Tag("OFX").subtag(signOnResponse()).subtag(creditCardStatementResponse(_dtstart));
@@ -448,7 +448,7 @@ const QByteArray MyMoneyOfxConnector::statementResponse(const QDate& _dtstart) c
request = header() + Tag("OFX").subtag(signOnResponse()).subtag(bankStatementResponse(_dtstart));
// remove the trailing zero
- QByteArray result = request.utf8();
+ TQByteArray result = request.utf8();
result.truncate(result.size()-1);
return result;
@@ -456,7 +456,7 @@ const QByteArray MyMoneyOfxConnector::statementResponse(const QDate& _dtstart) c
MyMoneyOfxConnector::Tag MyMoneyOfxConnector::signOnResponse(void) const
{
- QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
+ TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
Tag sonrs("SONRS");
sonrs
@@ -480,7 +480,7 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::signOnResponse(void) const
return Tag("SIGNONMSGSRSV1").subtag(sonrs);
}
-MyMoneyOfxConnector::Tag MyMoneyOfxConnector::messageResponse(const QString& _msgType, const QString& _trnType, const Tag& _response)
+MyMoneyOfxConnector::Tag MyMoneyOfxConnector::messageResponse(const TQString& _msgType, const TQString& _trnType, const Tag& _response)
{
return Tag(_msgType+"MSGSRSV1")
.subtag(Tag(_trnType+"TRNRS")
@@ -490,20 +490,20 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::messageResponse(const QString& _ms
.subtag(_response));
}
-MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementResponse(const QDate& _dtstart) const
+MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementResponse(const TQDate& _dtstart) const
{
MyMoneyFile* file = MyMoneyFile::instance();
- QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
- QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
+ TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
+ TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
- QString transactionlist;
+ TQString transactionlist;
MyMoneyTransactionFilter filter;
- filter.setDateFilter(_dtstart,QDate::currentDate());
+ filter.setDateFilter(_dtstart,TQDate::tqcurrentDate());
filter.addAccount(m_account.id());
- QValueList<MyMoneyTransaction> transactions = file->transactionList(filter);
- QValueList<MyMoneyTransaction>::const_iterator it_transaction = transactions.begin();
+ TQValueList<MyMoneyTransaction> transactions = file->transactionList(filter);
+ TQValueList<MyMoneyTransaction>::const_iterator it_transaction = transactions.begin();
while ( it_transaction != transactions.end() )
{
transactionlist += transaction( *it_transaction );
@@ -514,23 +514,23 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementResponse(const QDate&
.element("CURDEF","USD")
.subtag(Tag("BANKACCTFROM").element("BANKID", iban()).element("ACCTID", accountnum()).element("ACCTTYPE", "CHECKING"))
.subtag(Tag("BANKTRANLIST").element("DTSTART",dtstart_string).element("DTEND",dtnow_string).data(transactionlist))
- .subtag(Tag("LEDGERBAL").element("BALAMT",file->balance(m_account.id()).formatMoney(QString(),2)).element("DTASOF",dtnow_string )));
+ .subtag(Tag("LEDGERBAL").element("BALAMT",file->balance(m_account.id()).formatMoney(TQString(),2)).element("DTASOF",dtnow_string )));
}
-MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardStatementResponse(const QDate& _dtstart) const
+MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardStatementResponse(const TQDate& _dtstart) const
{
MyMoneyFile* file = MyMoneyFile::instance();
- QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
- QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
+ TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
+ TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
- QString transactionlist;
+ TQString transactionlist;
MyMoneyTransactionFilter filter;
- filter.setDateFilter(_dtstart,QDate::currentDate());
+ filter.setDateFilter(_dtstart,TQDate::tqcurrentDate());
filter.addAccount(m_account.id());
- QValueList<MyMoneyTransaction> transactions = file->transactionList(filter);
- QValueList<MyMoneyTransaction>::const_iterator it_transaction = transactions.begin();
+ TQValueList<MyMoneyTransaction> transactions = file->transactionList(filter);
+ TQValueList<MyMoneyTransaction>::const_iterator it_transaction = transactions.begin();
while ( it_transaction != transactions.end() )
{
transactionlist += transaction( *it_transaction );
@@ -541,24 +541,24 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardStatementResponse(const
.element("CURDEF","USD")
.subtag(Tag("CCACCTFROM").element("ACCTID", accountnum()))
.subtag(Tag("BANKTRANLIST").element("DTSTART",dtstart_string).element("DTEND",dtnow_string).data(transactionlist))
- .subtag(Tag("LEDGERBAL").element("BALAMT",file->balance(m_account.id()).formatMoney(QString(),2)).element("DTASOF",dtnow_string )));
+ .subtag(Tag("LEDGERBAL").element("BALAMT",file->balance(m_account.id()).formatMoney(TQString(),2)).element("DTASOF",dtnow_string )));
}
-QString MyMoneyOfxConnector::investmentStatementResponse(const QDate& _dtstart) const
+TQString MyMoneyOfxConnector::investmentStatementResponse(const TQDate& _dtstart) const
{
MyMoneyFile* file = MyMoneyFile::instance();
- QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
- QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]"));
+ TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
+ TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]"));
- QString transactionlist;
+ TQString transactionlist;
MyMoneyTransactionFilter filter;
- filter.setDateFilter(_dtstart,QDate::currentDate());
+ filter.setDateFilter(_dtstart,TQDate::tqcurrentDate());
filter.addAccount(m_account.id());
filter.addAccount(m_account.accountList());
- QValueList<MyMoneyTransaction> transactions = file->transactionList(filter);
- QValueList<MyMoneyTransaction>::const_iterator it_transaction = transactions.begin();
+ TQValueList<MyMoneyTransaction> transactions = file->transactionList(filter);
+ TQValueList<MyMoneyTransaction>::const_iterator it_transaction = transactions.begin();
while ( it_transaction != transactions.end() )
{
transactionlist += investmentTransaction( *it_transaction );
@@ -575,8 +575,8 @@ QString MyMoneyOfxConnector::investmentStatementResponse(const QDate& _dtstart)
securitylist.subtag(Tag("STOCKINFO")
.subtag(Tag("SECINFO")
.subtag(Tag("SECID")
- .element("UNIQUEID",equity.id())
- .element("UNIQUEIDTYPE","KMYMONEY"))
+ .element("UNITQUEID",equity.id())
+ .element("UNITQUEIDTYPE","KMYMONEY"))
.element("SECNAME",equity.name())
.element("TICKER",equity.tradingSymbol())
.element("FIID",equity.id())));
@@ -612,8 +612,8 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::transaction(const MyMoneyTransacti
// This is a temporary hack. I don't use the trntype field in importing at all,
// but libofx requires it to be there in order to import the file.
.element("TRNTYPE","DEBIT")
- .element("DTPOSTED",_t.postDate().toString(Qt::ISODate).remove(QRegExp("[^0-9]")))
- .element("TRNAMT",s.value().formatMoney(QString(),2));
+ .element("DTPOSTED",_t.postDate().toString(Qt::ISODate).remove(TQRegExp("[^0-9]")))
+ .element("TRNAMT",s.value().formatMoney(TQString(),2));
if ( ! _t.bankID().isEmpty() )
result.element("FITID",_t.bankID());
@@ -639,10 +639,10 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone
//Use this version for inv transactions
MyMoneySplit s = _t.splitByAccount( m_account.accountList(), true );
- QCString stockid = file->account(s.accountId()).currencyId();
+ TQCString stockid = file->account(s.accountId()).currencyId();
Tag invtran("INVTRAN");
- invtran.element("FITID",_t.id()).element("DTTRADE",_t.postDate().toString(Qt::ISODate).remove(QRegExp("[^0-9]")));
+ invtran.element("FITID",_t.id()).element("DTTRADE",_t.postDate().toString(Qt::ISODate).remove(TQRegExp("[^0-9]")));
if ( !_t.memo().isEmpty() )
invtran.element("MEMO",_t.memo());
@@ -653,10 +653,10 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone
return Tag("SELLSTOCK")
.subtag(Tag("INVSELL")
.subtag(invtran)
- .subtag(Tag("SECID").element("UNIQUEID",stockid).element("UNIQUEIDTYPE","KMYMONEY"))
- .element("UNITS",QString(((s.shares())).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]")))
- .element("UNITPRICE",QString((s.value()/s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.]")))
- .element("TOTAL",QString((-s.value()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]")))
+ .subtag(Tag("SECID").element("UNITQUEID",stockid).element("UNITQUEIDTYPE","KMYMONEY"))
+ .element("UNITS",TQString(((s.shares())).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]")))
+ .element("UNITPRICE",TQString((s.value()/s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.]")))
+ .element("TOTAL",TQString((-s.value()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]")))
.element("SUBACCTSEC","CASH")
.element("SUBACCTFUND","CASH"))
.element("SELLTYPE","SELL");
@@ -666,10 +666,10 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone
return Tag("BUYSTOCK")
.subtag(Tag("INVBUY")
.subtag(invtran)
- .subtag(Tag("SECID").element("UNIQUEID",stockid).element("UNIQUEIDTYPE","KMYMONEY"))
- .element("UNITS",QString((s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]")))
- .element("UNITPRICE",QString((s.value()/s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.]")))
- .element("TOTAL",QString((-(s.value())).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]")))
+ .subtag(Tag("SECID").element("UNITQUEID",stockid).element("UNITQUEIDTYPE","KMYMONEY"))
+ .element("UNITS",TQString((s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]")))
+ .element("UNITPRICE",TQString((s.value()/s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.]")))
+ .element("TOTAL",TQString((-(s.value())).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]")))
.element("SUBACCTSEC","CASH")
.element("SUBACCTFUND","CASH"))
.element("BUYTYPE","BUY");
@@ -682,22 +682,22 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone
return Tag("REINVEST")
.subtag(invtran)
- .subtag(Tag("SECID").element("UNIQUEID",stockid).element("UNIQUEIDTYPE","KMYMONEY"))
+ .subtag(Tag("SECID").element("UNITQUEID",stockid).element("UNITQUEIDTYPE","KMYMONEY"))
.element("INCOMETYPE","DIV")
- .element("TOTAL",QString((-s.value()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]")))
+ .element("TOTAL",TQString((-s.value()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]")))
.element("SUBACCTSEC","CASH")
- .element("UNITS",QString((s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]")))
- .element("UNITPRICE",QString((s.value()/s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.]")));
+ .element("UNITS",TQString((s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]")))
+ .element("UNITPRICE",TQString((s.value()/s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.]")));
}
else if ( s.action() == MyMoneySplit::ActionDividend )
{
// find the split with the category, which has the actual amount of the dividend
- QValueList<MyMoneySplit> splits = _t.splits();
- QValueList<MyMoneySplit>::const_iterator it_split = splits.begin();
+ TQValueList<MyMoneySplit> splits = _t.splits();
+ TQValueList<MyMoneySplit>::const_iterator it_split = splits.begin();
bool found = false;
while( it_split != splits.end() )
{
- QCString accid = (*it_split).accountId();
+ TQCString accid = (*it_split).accountId();
MyMoneyAccount acc = file->account(accid);
if ( acc.accountType() == MyMoneyAccount::Income || acc.accountType() == MyMoneyAccount::Expense )
{
@@ -710,9 +710,9 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone
if ( found )
return Tag("INCOME")
.subtag(invtran)
- .subtag(Tag("SECID").element("UNIQUEID",stockid).element("UNIQUEIDTYPE","KMYMONEY"))
+ .subtag(Tag("SECID").element("UNITQUEID",stockid).element("UNITQUEIDTYPE","KMYMONEY"))
.element("INCOMETYPE","DIV")
- .element("TOTAL",QString((-(*it_split).value()).formatMoney(QString(),2)).remove(QRegExp("[^0-9\\.\\-]")))
+ .element("TOTAL",TQString((-(*it_split).value()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9\\.\\-]")))
.element("SUBACCTSEC","CASH")
.element("SUBACCTFUND","CASH");
else