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 326150 - Advanced Portfolio Report fails to generate due to number of digits specified as a float
Advanced Portfolio Report fails to generate due to number of digits specified...
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Reports
1.8.x
Other All
: Normal normal
: ---
Assigned To: Chris Lyttle
Chris Lyttle
: 133598 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-01-07 22:43 UTC by mtaschuk
Modified: 2018-06-29 20:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description mtaschuk 2006-01-07 22:43:05 UTC
Please describe the problem:
The advanced portfolio report allows one to specify the number of digits for
listing the number of shares a user has.  This value appears to be handled as
a float, which causes an error:

Wrong type (inexact) in position ....

The report will not generate at all with this bug.

Steps to reproduce:
1. Generate an Advanced Portfolio Report
2. 
3. 


Actual results:
Gnucash report that an error was generated during report generation.

Expected results:
A list of all shares, with price information and such like in a table.

Does this happen every time?
Yes.

Other information:
Linux 2.4.27/Debian (testing)/GnuCash 1.8.10/Guile 1.6.7

A workaround can be made by replacing line 42 of
/usr/share/gnucash/guile-modules/gnucash/report/advanced-portfolio.scm with

(define optname-shares-digits (N_ 3))   

For 3 digit precision in the output table.
Comment 1 mtaschuk 2006-01-07 22:44:20 UTC
Please contact me at mtaschuk@ece.ualberta.ca if additional information or tests are required.
Comment 2 Christian Stimming 2006-01-09 09:47:20 UTC
Other bugs concerning the Advanced Portfolio report are bug#105466, bug#115267, bug#314554 (maybe all three are duplicates of each other), bug#311549, bug#312049 .
Comment 3 mtaschuk 2006-01-21 17:13:36 UTC
Brian Lucas has found another workaround for this bug.  His solution:

I found the sticky file.  In ~/.gnucash/books/ there is a file with a name
corresponding to the pathname to your gnucash data file (with %2F instead
of slashes in the pathname).  Within that file, when you change the
fractional digits in share amount, the following is added:

(let ((option (gnc:lookup-option options
                 "General"
                 "Share decimal places")))
  ((lambda (option) (if option ((gnc:option-setter option) 3.0)))
option))

If you change the 3.0 to just 3, things appear to work for me. 
Comment 4 Mike Alexander 2006-02-08 07:01:28 UTC
This bug has been fixed in 1.9.x.  I previously fixed it in 1.8.x by adding a call to inexact->exact in the appropriate place and when I merged that change to 1.9 I discovered it was already there.  I don't know exactly when it was fixed.  It occurred (and was fixed) in both the portfolio and advanced-portfolio reports.
Comment 5 Derek Atkins 2006-02-12 20:37:01 UTC
Okay, I'll take your word for it that this is fixed in 1.9.0.
I'm closing this bug.
Comment 6 Derek Atkins 2006-03-13 17:25:59 UTC
*** Bug 133598 has been marked as a duplicate of this bug. ***
Comment 7 John Ralls 2018-06-29 20:55:02 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=326150. Please update any external references or bookmarks.