[Kmymoney-devel] [Bug 276315] New: Illogical message when editing investment

allan agander93 at gmail.com
Thu Jun 23 11:28:59 CEST 2011


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

           Summary: Illogical message when editing investment
           Product: kmymoney4
           Version: SVN trunk
          Platform: Debian testing
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kmymoney-devel at kde.org
        ReportedBy: agander93 at gmail.com


Version:           SVN trunk (using KDE 4.6.0) 
OS:                Linux

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.

Reproducible: Always

Steps to Reproduce:
1) Import a cash dividend transaction into a file that does not have a
'Dividend' category.
2) Open that transaction in the ledger and edit it.
3) Accept the change.



Actual Results:  
4) Currency/Price editor wizard opens.

Expected Results:  
Currency/Price editor wizard should not intervene.

I'll add to reviewboard.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list