[Kmymoney-devel] Review Request: Illogical message when editing investment

Allan Anderson agander93 at gmail.com
Thu Jun 23 12:19:48 CEST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/6732/
-----------------------------------------------------------

Review request for kmymoney.


Summary
-------

When manually adding an account to an IntInc record that has been flagged
during import, on entering the edited transaction, the Exchange Rate/Price
wizard pops up, asking to convert from GBP to GBP.
It also shows if an unflagged DivX has its value edited.  Apart from the
illogicality of wishing to convert from GBP to GBP, there is the question of
why a currency/price editor shows when no price is involved.

I've had a look at this, and what seems to be the problem, is that this
occurs if the transaction in question has a category which has been
created during import.  If the category is created beforehand, the
currency wizard doesn't open.  It seems to be because, in
investmementtransactioneditor.cpp, circa line 887,
acc.currencyId() != t.commodity()) , because t.commodity() = GBP, and
acc.currencyId() (say, for a Dividend category) is empty.

As this is in the routine InvestTransactionEditor::setupPrice(), eventually I
decided that the root cause was probably that that routine should not have been
called.

Eventually I worked back to Activity::createCategorySplits and made the
following change at line 119 -
if ((!s1.value().isZero()) && (!s1.actualPrice().isZero())){
          rc = m_parent->setupPrice
and adding in that test for a zero price appears to fix the problem.

Also, in investactivities.cpp, in Div::createTransaction() and in IntInc::createTransaction(), 
I have commented out -

if (!m_parent->setupPrice(t, assetAccountSplit))
+///    return false;

as, for the same reason, these routines should have no involvement with prices.


This addresses bug 276315.
    https://bugs.kde.org/show_bug.cgi?id=276315


Diffs
-----

  /trunk/extragear/office/kmymoney/kmymoney/dialogs/investactivities.cpp 1238152 

Diff: http://svn.reviewboard.kde.org/r/6732/diff


Testing
-------

Confirmed that the file that showed the problem, no longer does.  Also, no apparent 
problem with my live file.


Thanks,

Allan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kmymoney-devel/attachments/20110623/0e8bfeb0/attachment.htm 


More information about the KMyMoney-devel mailing list