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 608436 - Add auto-clear feature
Add auto-clear feature
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: User Interface General
git-master
Other Linux
: Normal enhancement
: ---
Assigned To: David Hampton
Chris Shoemaker
Depends on:
Blocks:
 
 
Reported: 2010-01-29 12:51 UTC by Cristian KLEIN
Modified: 2018-06-29 22:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch against trunk, implemented the described feature. (27.39 KB, patch)
2010-01-29 12:54 UTC, Cristian KLEIN
none Details | Review
Patch against trunk which implements this feature. (27.43 KB, patch)
2010-01-30 15:27 UTC, Cristian KLEIN
committed Details | Review
Use g_str_hash() instead of g_double_hash() for glib-2.16 compatibility (779 bytes, patch)
2010-02-04 20:49 UTC, Cristian KLEIN
committed Details | Review

Description Cristian KLEIN 2010-01-29 12:51:29 UTC
= Usage scenario =
John keeps his personal accounting in GnuCash and writes all credit card expenses therein. On weekends, we checks his Internet Banking and sees that some transactions have been recorded. He would like to clear those transactions in GnuCash, but it is tiresome to go through each Internet Banking transaction and do manual comparison with GnuCash records, especially since Internet Banking transactions might be in a different order than in GnuCash.

John would prefer having an "auto-clear" feature. Given the "current amount" from the Internet Banking, he would like GnuCash to clear the transactions for him, if and only if, there is a unique combination of transactions that could achieve this. If there is no solution, or if the solution is not unique, GnuCash should warn him and John must manually clear the transactions.
Comment 1 Cristian KLEIN 2010-01-29 12:54:02 UTC
Created attachment 152565 [details] [review]
Patch against trunk, implemented the described feature.

Please review and comment.
Comment 2 Cristian KLEIN 2010-01-30 15:27:18 UTC
Created attachment 152636 [details] [review]
Patch against trunk which implements this feature.

Fixed issues pointed out by Yawar Amin.
Comment 3 Christian Stimming 2010-02-01 14:35:31 UTC
Comment on attachment 152636 [details] [review]
Patch against trunk which implements this feature.

We should give this a try - thanks for the patch!
Comment 4 Christian Stimming 2010-02-03 21:29:30 UTC
Comment on attachment 152636 [details] [review]
Patch against trunk which implements this feature.

r18610
Comment 5 John Ralls 2010-02-04 19:46:27 UTC
This patch breaks the build for Debian Stable (Lenny), because it uses g_double_hash() in window-autoclear.c at line 107. g_double_hash was introduced only in glib-2.22. Debian Stable uses glib-2.16; glib 2-22 was released only last September.
Comment 6 Cristian KLEIN 2010-02-04 20:49:34 UTC
Created attachment 153036 [details] [review]
Use g_str_hash() instead of g_double_hash() for glib-2.16 compatibility

Since the denominator is the same for all gnc_numeric-s manipulated in that hash table, we can safely use g_str_hash() instead of g_double_hash(). This patch must be applied above Attachement 152636.
Comment 7 John Ralls 2010-02-04 23:19:55 UTC
Thanks, that does it. Committed in r18612.
Comment 8 Christian Stimming 2010-02-18 07:41:16 UTC
bug#610321 reports some functions which are unavailable in older glib/gtk: GTK_BUTTONBOX_CENTER requires gtk-2.11, but we would like to get along with gtk-2.10; maybe you can enclose the macro with #if GTK_CHECK_VERSION().

GHashTableIter requires glib-2.16, but we would like to get along with glib-2.6.

Can you please try to fix the compatibility with that versions? Thanks!
Comment 9 Cristian KLEIN 2010-02-18 10:06:37 UTC
Okey, I'll see what I can do.
Comment 10 Christian Stimming 2010-02-19 14:50:02 UTC
Comment on attachment 153036 [details] [review]
Use g_str_hash() instead of g_double_hash() for glib-2.16 compatibility

I got confused by the status of this patch. jralls committed something inspired from this in r18612, but it was broken and subsequently corrected in r18632.
Comment 11 John Ralls 2010-02-19 22:53:05 UTC
The history here seems pretty clear to me. The only part that might be confusing is some extra work in r18612 to fix a couple of strict-aliasing errors. That was partly wrong and fixed in r18632, but it didn't have anything to do with this bug. 

Cristian Klein provided attachment 154146 [details] [review] to bug 610321 that he says corrects the GHashTableIter issue. I guess someone who still has glib-2.6 around needs to make sure that it compiles and works in that (ancient) environment and commit it if it does.
Comment 12 Geert Janssens 2010-02-20 09:41:26 UTC
The glib-2.6 compatibility is silly. No actively maintained distribution still ships it. The most conservative one (RHEL5) ships 2.12 already.

I requested to bump this requirement, but apart from John no other dev has voiced his opinion yet.

But regarding this bug: if I understand John correctly it can be closed. The patches in this bug are applied, and the new bugs this enhancement introduced are being tracked in bug 610321.
Comment 13 John Ralls 2018-06-29 22:34:15 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=608436. Please update any external references or bookmarks.