After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 350658 - Advanced Portfolio: Incorrect currency conversion on the money-in and money-out column
Advanced Portfolio: Incorrect currency conversion on the money-in and money-o...
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Reports
2.0.x
Other All
: Normal normal
: ---
Assigned To: Andrew Sackville-West
Chris Lyttle
Depends on:
Blocks:
 
 
Reported: 2006-08-09 23:08 UTC by Thierry Scalais
Modified: 2018-06-29 21:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample book (1.48 KB, application/xml)
2006-08-09 23:25 UTC, Thierry Scalais
  Details
Modified advanced-portfolio report (28.62 KB, text/plain)
2006-08-13 14:36 UTC, Thierry Scalais
  Details
txn-currency.patch (2.88 KB, patch)
2007-12-22 06:29 UTC, Andrew Sackville-West
needs-work Details | Review

Description Thierry Scalais 2006-08-09 23:08:14 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:
Comment 1 Thierry Scalais 2006-08-09 23:25:36 UTC
Created attachment 70597 [details]
sample book
Comment 2 Christian Stimming 2006-08-10 09:25:55 UTC
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.
Comment 3 Thierry Scalais 2006-08-11 12:50:30 UTC
(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.

Comment 4 Thierry Scalais 2006-08-13 14:36:40 UTC
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.
Comment 5 Richard Laager 2007-12-17 02:21:19 UTC
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
Comment 6 Andrew Sackville-West 2007-12-17 18:12:19 UTC
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. 
Comment 7 Andrew Sackville-West 2007-12-19 20:22:13 UTC
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.
Comment 8 Andrew Sackville-West 2007-12-22 06:29:46 UTC
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.
Comment 9 Mario 2008-03-25 14:57:27 UTC
Bug is still present in the current 2.2.4.
Comment 10 Rolf Leggewie 2008-07-11 15:21:27 UTC
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?
Comment 11 Phil Longstaff 2009-05-01 13:35:11 UTC
Andrew, according to Rolf, 1 hunk out of 5 fails to apply again.  Can you rebase it?
Comment 12 Stephan Walter 2012-02-14 18:19:57 UTC
The Income column has the same problem. I reported this as Bug 670009 (with a test file) before I saw this bug.
Comment 13 Mike Alexander 2014-01-20 00:43:47 UTC
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.
Comment 14 John Ralls 2018-06-29 21:11:09 UTC
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.