summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/traninfo.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/checkbook/traninfo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/checkbook/traninfo.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/noncore/apps/checkbook/traninfo.cpp b/noncore/apps/checkbook/traninfo.cpp
index 5a770b0..460466c 100644
--- a/noncore/apps/checkbook/traninfo.cpp
+++ b/noncore/apps/checkbook/traninfo.cpp
@@ -21,24 +21,26 @@
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "traninfo.h"
#include <qpe/config.h>
+QString tempstr;
+
TranInfo::TranInfo( int id, const QString &desc, const QDate &date, bool withdrawal,
const QString &type, const QString &category, float amount,
float fee, const QString &number, const QString &notes )
{
i = id;
d = desc;
td = date;
w = withdrawal;
t = type;
c = category;
a = amount;
f = fee;
@@ -108,33 +110,50 @@ TranInfo::TranInfo( Config config, int entry )
// Transaction fee
stramount = config.readEntry( "TransactionFee", "0.00" );
f = stramount.toFloat( &ok );
// Transaction number
cn = config.readEntry( "CheckNumber", "" );
// Notes
n = config.readEntry( "Comments", "" );
}
}
+const QString &TranInfo::datestr()
+{
+ tempstr = QString::number( td.year() );
+ tempstr.append( '/' );
+ int tempfield = td.month();
+ if ( tempfield < 10 ) tempstr.append( '0' );
+ tempstr.append( QString::number( tempfield ) );
+ tempstr.append( '/' );
+ tempfield = td.day();
+ if ( tempfield < 10 ) tempstr.append( '0' );
+ tempstr.append( QString::number( tempfield ) );
+
+ return( tempstr );
+}
+
void TranInfo::write( Config *config, int entry )
{
config->setGroup( QString::number( entry ) );
config->writeEntry( "Description", d );
- QString tempstr = QString::number( td.month() ) + "/" +
- QString::number( td.day() ) + "/" +
- QString::number( td.year() );
+ tempstr = QString::number( td.month() );
+ tempstr.append( '/' );
+ tempstr.append( QString::number( td.day() ) );
+ tempstr.append( '/' );
+ tempstr.append( QString::number( td.year() ) );
config->writeEntry( "Date", tempstr );
w ? tempstr = "true"
: tempstr = "false";
config->writeEntry( "Payment", tempstr );
if ( t == "Debit Charge" || t == "Written Check" )
tempstr = "0";
else if ( t == "Written Check" || t == "Automatic Payment" )
tempstr = "1";
else if ( t == "Transfer" )
tempstr = "2";