<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/6732/">http://svn.reviewboard.kde.org/r/6732/</a>
     </td>
    </tr>
   </table>
   <br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://svn.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for kmymoney.</div>
<div>By Allan Anderson.</div>


<p style="color: grey;"><i>Updated July 4, 2011, 3:12 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Mea culpa.

When I re-wrote MyMoneyStatementReader::Private::nameToId(), in order to handle
categories with sub-categories, I borrowed some code from
KMyMoneyApp::createAccount(), pruning it in the process.

What I should not have omitted was the creation of a currencyId for the new
category.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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&#39;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&#39;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()) &amp;&amp; (!s1.actualPrice().isZero())){
          rc = m_parent-&gt;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-&gt;setupPrice(t, assetAccountSplit))
+///    return false;

as, for the same reason, these routines should have no involvement with prices.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Confirmed that the file that showed the problem, no longer does.  Also, no apparent 
problem with my live file.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://bugs.kde.org/show_bug.cgi?id=276315">276315</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/extragear/office/kmymoney/kmymoney/converter/mymoneystatementreader.cpp <span style="color: grey">(1239271)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/6732/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>




  </div>
 </body>
</html>