Diffstat (limited to 'noncore/apps/checkbook/checkbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/checkbook.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp index 706d970..44d3764 100644 --- a/noncore/apps/checkbook/checkbook.cpp +++ b/noncore/apps/checkbook/checkbook.cpp | |||
@@ -334,6 +334,7 @@ void Checkbook::loadCheckbook() | |||
334 | // Load transactions | 334 | // Load transactions |
335 | float amount; | 335 | float amount; |
336 | QString stramount; | 336 | QString stramount; |
337 | QString symbol = _pCfg->getCurrencySymbol(); | ||
337 | for ( TranInfo *tran = tranList->first(); tran; tran = tranList->next() ) | 338 | for ( TranInfo *tran = tranList->first(); tran; tran = tranList->next() ) |
338 | { | 339 | { |
339 | amount = tran->amount(); | 340 | amount = tran->amount(); |
@@ -341,7 +342,8 @@ void Checkbook::loadCheckbook() | |||
341 | { | 342 | { |
342 | amount *= -1; | 343 | amount *= -1; |
343 | } | 344 | } |
344 | stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); | 345 | stramount.sprintf( "%.2f", amount ); |
346 | stramount.prepend( symbol ); | ||
345 | ( void ) new CBListItem( tran, tranTable, tran->getIdStr(), tran->datestr(false), tran->number(), tran->datestr(true), tran->desc(), stramount ); | 347 | ( void ) new CBListItem( tran, tranTable, tran->getIdStr(), tran->datestr(false), tran->number(), tran->datestr(true), tran->desc(), stramount ); |
346 | } | 348 | } |
347 | 349 | ||
@@ -370,11 +372,14 @@ void Checkbook::adjustBalance() | |||
370 | { | 372 | { |
371 | // update running balance in register | 373 | // update running balance in register |
372 | QString sRunning; | 374 | QString sRunning; |
375 | QString symbol = _pCfg->getCurrencySymbol(); | ||
373 | float bal=info->startingBalance(); | 376 | float bal=info->startingBalance(); |
377 | |||
374 | for(CBListItem *item=(CBListItem *)tranTable->firstChild(); item; item=(CBListItem *)item->nextSibling() ) { | 378 | for(CBListItem *item=(CBListItem *)tranTable->firstChild(); item; item=(CBListItem *)item->nextSibling() ) { |
375 | TranInfo *tran=item->getTranInfo(); | 379 | TranInfo *tran=item->getTranInfo(); |
376 | bal=bal + (tran->withdrawal() ? -1 : 1)*tran->amount() - tran->fee(); | 380 | bal=bal + (tran->withdrawal() ? -1 : 1)*tran->amount() - tran->fee(); |
377 | sRunning.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), bal ); | 381 | sRunning.sprintf( "%.2f", bal ); |
382 | sRunning.prepend(symbol); | ||
378 | item->setText( COL_BAL, sRunning); | 383 | item->setText( COL_BAL, sRunning); |
379 | } | 384 | } |
380 | } | 385 | } |
@@ -482,6 +487,7 @@ void Checkbook::slotNewTran() | |||
482 | Transaction *currtran = new Transaction( this, true, info->name(), | 487 | Transaction *currtran = new Transaction( this, true, info->name(), |
483 | traninfo, | 488 | traninfo, |
484 | _pCfg ); | 489 | _pCfg ); |
490 | QString symbol = _pCfg->getCurrencySymbol(); | ||
485 | if ( QPEApplication::execDialog( currtran ) == QDialog::Accepted ) | 491 | if ( QPEApplication::execDialog( currtran ) == QDialog::Accepted ) |
486 | { | 492 | { |
487 | // Add to transaction list | 493 | // Add to transaction list |
@@ -490,8 +496,9 @@ void Checkbook::slotNewTran() | |||
490 | // Add to transaction table | 496 | // Add to transaction table |
491 | float amount; | 497 | float amount; |
492 | QString stramount; | 498 | QString stramount; |
493 | amount = (traninfo->withdrawal() ? -1 : 1)*traninfo->amount(); | 499 | amount = (traninfo->withdrawal() ? -1 : 1)*traninfo->amount(); |
494 | stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); | 500 | stramount.sprintf( "%.2f", amount ); |
501 | stramount.prepend(symbol); | ||
495 | ( void ) new CBListItem( traninfo, tranTable, traninfo->getIdStr(), traninfo->datestr(false), | 502 | ( void ) new CBListItem( traninfo, tranTable, traninfo->getIdStr(), traninfo->datestr(false), |
496 | traninfo->number(), traninfo->datestr(true), traninfo->desc(), | 503 | traninfo->number(), traninfo->datestr(true), traninfo->desc(), |
497 | stramount ); | 504 | stramount ); |
@@ -541,7 +548,8 @@ void Checkbook::slotEditTran() | |||
541 | amount *= -1; | 548 | amount *= -1; |
542 | } | 549 | } |
543 | QString stramount; | 550 | QString stramount; |
544 | stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); | 551 | stramount.sprintf( "%.2f", amount ); |
552 | stramount.prepend( _pCfg->getCurrencySymbol() ); | ||
545 | curritem->setText( COL_AMOUNT, stramount ); | 553 | curritem->setText( COL_AMOUNT, stramount ); |
546 | resort(); | 554 | resort(); |
547 | adjustBalance(); | 555 | adjustBalance(); |