GNOME Bugzilla – Bug 350658
Advanced Portfolio: Incorrect currency conversion on the money-in and money-out column
Last modified: 2018-06-29 21:11:09 UTC
Please describe the problem: When the stock price currency is not the currency of the stocks account, the conversion factor 'price currency' to 'account currency' is applied on the 'money in' and 'money out' and related columns. The 'Value' column is correctly computed. Steps to reproduce: 1. Create a stocks account in euro (default currency) for a stock valued in USD 2. buy 100 share for EUR80 3. edit stock price to $1 4. edit USD price to 0.8 euro 5. generate the advanced portfolio with EUR as currency report Actual results: the money-in column reports 64EUR that is 0.8*80EUR Expected results: The money-in column should report 80EUR Does this happen every time? Other information:
Created attachment 70597 [details] sample book
This concerns the "advanced portfolio" report, right? Other bugs in that report are bug#115267 bug#336240 bug#343245 bug#344566 bug#346062 bug#347739 . Would you mind going through them and check whether your problem is a duplicate of any of them, or vice versa? If it is, please close this or the other bug (whichever has less description) by marking it as a duplicate. Thanks.
(In reply to comment #2) That concerns effectively adanced-portfolio. It doesn't seem directly related to any one of these bugs. N.B.: With gnucash 1.8.12, the report was correct.
Created attachment 70819 [details] Modified advanced-portfolio report I modified the original advanced-portfolio.scm this way: 1/I initiliase txn-currency to the currency of the current transaction 2/I replaced commod-currency by txn_currency in the computation of basis-list, moneyoutcoll, moneyincoll, brokeragecoll and dividendcoll. At first sight, it fixes the bug.
In trunk, specifically with the advanced portfolio from r16637, I can confirm that this is still behaving as described in this bug with the test file. Thierry Scalais: As you posted a new file and not a patch, could you take a look at the current version here and see if you can apply your changes to that: http://svn.gnucash.org/trac/browser/gnucash/trunk/src/report/standard-reports/advanced-portfolio.scm
Yeah, I've been watching this one, but I'm just not up on the currency stuff at the moment. Based on Thierry's description in #4, I think I can refactor this into the current version. But as I'm not up on the whole currency exchange thing, I'm concerned about breaking other stuff. I'll look at this over the next couple days and put a patch to trunk up here. thanks Richard for CC'ing me on this.
Theirry, I like your changes, but second Richard's comment: please provide a unified diff against current svn, or at least against a recent stable version of the report. Your fix makes sense to me: the entry into the commodity collectors should be made in the currency of the particular transaction.
Created attachment 101450 [details] [review] txn-currency.patch I've forward ported this to latest SVN. But I don't work in multi-currency and can't adequately test it. If someone could apply this patch and try it out, I'd be grateful. My minimal testing shows that it works as described. But it also showed me that the exchange functions may not be working. :( But that's another issue.
Bug is still present in the current 2.2.4.
Comment on attachment 101450 [details] [review] txn-currency.patch (In reply to comment #8) > Created an attachment (id=101450) [edit] > txn-currency.patch > > I've forward ported this to latest SVN. 1 hunk out of 5 fails to apply again. Can you be bothered to rebase it once more?
Andrew, according to Rolf, 1 hunk out of 5 fails to apply again. Can you rebase it?
The Income column has the same problem. I reported this as Bug 670009 (with a test file) before I saw this bug.
I think this may be fixed in the changes I checked in today. These will be in version 2.6.1 or you can try them in the meantime by replacing the Advanced Portfolio report with the copy at http://svn.gnucash.org/trac/browser/gnucash/trunk/src/report/standard-reports/advanced-portfolio.scm. Let me know if it still fails.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=350658. Please update any external references or bookmarks.