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 680104 - formula not calculated when variables are mixed with constants
formula not calculated when variables are mixed with constants
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Scheduled Transactions
2.4.x
Other Windows
: Normal normal
: ---
Assigned To: Christian Stimming
gnucash-core-maint
: 759610 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-07-17 15:17 UTC by brad.hajek
Modified: 2018-06-29 23:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description brad.hajek 2012-07-17 15:17:26 UTC
Create a new Scheduled Transaction with the following template:

|Account   | Debit        | Credit |
|----------|--------------|--------|
|Checking  |              | 300    |
|Interest  | interest     |        |
|Liability | 300-interest |        |

When the Scheduled Transaction is entered in the register it comes out as the following:

|Account       | Debit    | Credit   |
|--------------|----------|----------|
|Checking      |          | 300      |
|Interest      | interest |          |
|Liability     | 300      |          |
|Imbalance-USD |          | interest |

Based on help from the mailing lists, it was determined the following works correctly:

|Account   | Debit          | Credit |
|----------|----------------|--------|
|Checking  |                | total  |
|Interest  | interest       |        |
|Liability | total-interest |        |

The articles linked in the FAQ show variables and constants in a multiplication formula. I created a transaction using a similar formula and it worked fine. The only difference I see here is that the variable comes first in the working formula whereas the constant comes first in the example above.
Comment 1 Eli 2013-03-17 01:44:04 UTC
I've experience the same issue.
Comment 2 John Ralls 2016-01-06 01:08:54 UTC
*** Bug 759610 has been marked as a duplicate of this bug. ***
Comment 3 John Ralls 2016-01-06 01:14:38 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Once that release is available, you may want to check for a software upgrade provided by your Linux distribution.

The problem was introduced by 4ea1ea02. The author of that commit thought that gnc_exp_parser_parse_separate_vars() returned false if there were no variables in the formula. It returns true unless the formula creates a numerical error.
Comment 4 John Ralls 2017-09-24 22:47:33 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 5 John Ralls 2018-06-29 23:09:35 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=680104. Please update any external references or bookmarks.