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 759610 - Variables in scheduled transactions replaced by 0 when evaluated
Variables in scheduled transactions replaced by 0 when evaluated
Status: RESOLVED DUPLICATE of bug 680104
Product: GnuCash
Classification: Other
Component: Scheduled Transactions
2.6.4
Other Linux
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2015-12-17 21:31 UTC by zach.inbox
Modified: 2018-06-29 23:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test file that shows the behavior (1.53 KB, application/x-gzip)
2015-12-17 21:56 UTC, Derek Atkins
Details

Description zach.inbox 2015-12-17 21:31:57 UTC
When entering formulas for scheduled transactions, some variables are replaced by 0 and behave strangely. 

Some examples with x = 10:

(x * 10) + (10)    = 10
(x * 10) - (10)    = -10
(x * 10) + (-10)   = -10
(x + 1) * 10       = 10
(x * 10) + (x * 1) = 110

Ubuntu 14.04 -- GnuCash 2.6.4

To reproduce:
1) Schedule a new transaction using one of the above formulas or some similar formula as a debit or credit amount.
2) Run that transaction.
Comment 1 zach.inbox 2015-12-17 21:34:23 UTC
(In reply to zach.inbox from comment #0)
> When entering formulas for scheduled transactions, some variables are
> replaced by 0 and behave strangely. 
> 
> Some examples with x = 10:
> 
> (x * 10) + (10)    = 10
> (x * 10) - (10)    = -10
> (x * 10) + (-10)   = -10
> (x + 1) * 10       = 10
> (x * 10) + (x * 1) = 110
> 
> Ubuntu 14.04 -- GnuCash 2.6.4
> 
> To reproduce:
> 1) Schedule a new transaction using one of the above formulas or some
> similar formula as a debit or credit amount.
> 2) Run that transaction.

Correction, running Ubuntu 15.04
Comment 2 Derek Atkins 2015-12-17 21:56:14 UTC
Created attachment 317590 [details]
Test file that shows the behavior

I was able to reproduce this in both 2.4.x and 2.6.5 (I don't have a current 2.6.9/maint/master built to test).  I've attached a simple file that shows the behavior.  Load the file, then Actions -> Since Last Run.  Assign "10" to x and then click on "view" to see the transactions that get created.  It should be 101.00, (x*10)+1 but it only shows $1.
Comment 3 John Ralls 2016-01-03 20:53:03 UTC
This looks like it might be a variation on bug 680104.
Comment 4 John Ralls 2016-01-06 01:08:54 UTC
Yup, it's a dup.

*** This bug has been marked as a duplicate of bug 680104 ***
Comment 5 John Ralls 2018-06-29 23:45:04 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=759610. Please update any external references or bookmarks.