Bug 272962 - The balance shown in the ledger is incorrect (0) in an Investment account once a transaction is selected
Summary: The balance shown in the ledger is incorrect (0) in an Investment account onc...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Unclassified
Component: general (show other bugs)
Version: SVN
Platform: Gentoo Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-10 19:00 UTC by Cristian Oneț
Modified: 2011-05-10 21:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cristian Oneț 2011-05-10 19:00:19 UTC
Version:           SVN trunk (using KDE 4.6.2) 
OS:                Linux

Report from Allan: "If I enter a buy transaction into an empty account, the summary at the foot of ledger view does not reflect the new balance.  Change to another account and then back, and the new value now appears.  An edit of an existing item shows the correct amount at once."
I can confirm this behavior.

Reproducible: Always

Steps to Reproduce:
1. Create a new investment account
2. Buy shares
3. Check that the balance is not updated



OS: Linux (x86_64) release 2.6.37-gentoo-r4
Compiler: x86_64-pc-linux-gnu-gcc
Comment 1 Cristian Oneț 2011-05-10 19:42:26 UTC
Actually just selecting a transaction in an investment account already set's the balance to 0. This is caused by the fact that investment accounts where not handled in this commit http://websvn.kde.org/?revision=1230806&view=revision I'm preparing a fix now.
Comment 2 Cristian Oneț 2011-05-10 19:54:01 UTC
SVN commit 1231291 by conet:

BUG: 272962
Display the correct balance in investment accounts.

 M  +20 -14    kgloballedgerview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1231291
Comment 3 allan 2011-05-10 20:02:44 UTC
(In reply to comment #1)
> Actually just selecting a transaction in an investment account already set's
> the balance to 0. This is caused by the fact that investment accounts where not
> handled in this commit http://websvn.kde.org/?revision=1230806&view=revision
> I'm preparing a fix now.

I was looking again at this and didn't quite understand what I was seeing.  While investigating a crash occurred.  I'll park the BT here in case it's relevant.

Application: KMyMoney (kmymoney), signal: Segmentation fault
[KCrash Handler]
#6  0x0000000000000000 in ?? ()
#7  0x00007f090c28e685 in QObject::disconnect(QObject const*, char const*, QObject const*, char const*) () from /usr/lib64/libQtCore.so.4
#8  0x00000000006c13ac in disconnect (this=0x1d188b0, __in_chrg=<value optimized out>) at /usr/include/QtCore/qobject.h:229
#9  TransactionEditor::~TransactionEditor (this=0x1d188b0, __in_chrg=<value optimized out>) at /home/aga/CSV/kmymoney/kmymoney/dialogs/transactioneditor.cpp:86
#10 0x0000000000640ef9 in InvestTransactionEditor::~InvestTransactionEditor (this=0x1d188b0, __in_chrg=<value optimized out>) at /home/aga/CSV/kmymoney/kmymoney/dialogs/investtransactioneditor.cpp:96
#11 0x000000000048693c in deleteTransactionEditor (this=0xd1db10) at /home/aga/CSV/kmymoney/kmymoney/kmymoney.cpp:5142
#12 KMyMoneyApp::slotTransactionsEnter (this=0xd1db10) at /home/aga/CSV/kmymoney/kmymoney/kmymoney.cpp:5202
#13 0x0000000000486ce5 in KMyMoneyApp::slotTransactionsCancelOrEnter (this=0xd1db10, okToSelect=@0x7fff86024aef) at /home/aga/CSV/kmymoney/kmymoney/kmymoney.cpp:5221
#14 0x00000000004a03f2 in KMyMoneyApp::qt_metacall (this=0xd1db10, _c=QMetaObject::InvokeMetaMethod, _id=80, _a=0x7fff860248c0) at /home/aga/CSV/kmymoney/build/kmymoney/kmymoney.moc:483
#15 0x00007f090c28edef in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#16 0x0000000000515d35 in KGlobalLedgerView::cancelOrEndEdit (this=<value optimized out>, _t1=<value optimized out>) at /home/aga/CSV/kmymoney/build/kmymoney/views/kgloballedgerview.moc:279
#17 0x0000000000521b65 in KGlobalLedgerView::qt_metacall (this=0x124be90, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x7fff86024ac0) at /home/aga/CSV/kmymoney/build/kmymoney/views/kgloballedgerview.moc:210
#18 0x00007f090c28edef in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#19 0x0000000000515a92 in MousePressFilter::mousePressedOnExternalWidget (this=<value optimized out>, _t1=<value optimized out>) at /home/aga/CSV/kmymoney/build/kmymoney/views/kgloballedgerview.moc:97
#20 0x0000000000515c06 in MousePressFilter::eventFilter (this=0x124c3e0, o=0x124d5f0, e=0x7fff860251d0) at /home/aga/CSV/kmymoney/kmymoney/views/kgloballedgerview.cpp:143
#21 0x00007f090c279ccb in QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
#22 0x00007f090b3cdc86 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#23 0x00007f090b3d6aac in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#24 0x00007f090e4c99e6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#25 0x00007f090c279bfc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
#26 0x00007f090b3ced25 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQtGui.so.4
#27 0x00007f090b44ce08 in ?? () from /usr/lib64/libQtGui.so.4
#28 0x00007f090b44b4c9 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
#29 0x00007f090b4730f2 in ?? () from /usr/lib64/libQtGui.so.4
#30 0x00007f090528cbd3 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#31 0x00007f090528d3b0 in ?? () from /lib64/libglib-2.0.so.0
#32 0x00007f090528d650 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#33 0x00007f090c2a491f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#34 0x00007f090b472d8e in ?? () from /usr/lib64/libQtGui.so.4
#35 0x00007f090c279052 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#36 0x00007f090c279265 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#37 0x00007f090c27d6ab in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4
#38 0x00000000004596ba in runKMyMoney (a=<value optimized out>, splash=<value optimized out>) at /home/aga/CSV/kmymoney/kmymoney/main.cpp:282
#39 0x000000000045b4fe in main (argc=1, argv=0x7fff86026af8) at /home/aga/CSV/kmymoney/kmymoney/main.cpp:181

I'll add your fix later and take another look.
Comment 4 Cristian Oneț 2011-05-10 20:08:27 UTC
Please use DrKonqi to report any crash that you encounter - no matter what. Usualy report it as a separate bug if it was not reported before (DrKonqi will help you find duplicates).
Comment 5 allan 2011-05-10 21:48:14 UTC
(In reply to comment #4)
> Please use DrKonqi to report any crash that you encounter - no matter what.
> Usualy report it as a separate bug if it was not reported before (DrKonqi will
> help you find duplicates).

Reported as 272974.

Now on Version 4.5.90-svn1231306 and all seems well.