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 310567 - RFE: multiple register sorting orders
RFE: multiple register sorting orders
Status: RESOLVED OBSOLETE
Product: GnuCash
Classification: Other
Component: Register
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Christian Stimming
Geert Janssens
: 150952 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-07-16 05:38 UTC by Mary Thompson
Modified: 2018-06-29 20:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Menu items to bump transactions forward and backward in time by seconds (4.04 KB, patch)
2009-11-01 20:12 UTC, Steven N. Severinghaus
none Details | Review
Adds a menu item to bump a transaction forward one second (3.04 KB, patch)
2009-11-01 20:26 UTC, Steven N. Severinghaus
needs-work Details | Review
Menu item to shift transaction forward (3.01 KB, patch)
2009-11-07 01:14 UTC, Steven N. Severinghaus
committed Details | Review

Description Mary Thompson 2005-07-16 05:38:30 UTC
Incorrect translation
Application: GnuCash

Incorrect text:
GnuCash (in standard sort order) displays most entries okay, but when I change
the date on an entry it is moved to the top of the day it was changed to.  i.e.
 I changed an entry from 7/16/05 to 7/15/05 and it move up above the entries
that were already dated 7/15/05, including a deposit that had been already made,
making it look like there wasn't money to cover the moved entry (a negative in
the total balance column).

Should be:
I would like to sort by multiple columns, specifically I would like to sort by
date, then by transfer (income/expense), and then by (check) number.
Comment 1 Christian Rose 2005-07-16 07:51:45 UTC
There is nothing in the report that suggests that this should be a bug in any
translation, so it appears this report was mis-filed. Moving to the GnuCash product.
Comment 2 Arnout 'raboof' Engelen 2005-10-25 10:48:42 UTC
I think this would also be solved by implementing bug 89439
Comment 3 Tim Wunder 2006-01-23 14:45:51 UTC
*** Bug 150952 has been marked as a duplicate of this bug. ***
Comment 4 Josh Sled 2006-04-30 16:11:39 UTC
update summary, severity.
Comment 5 Josh Andler 2007-03-19 20:36:27 UTC
I did also want to add myself to the list of people requesting this. The ability to have the transactions sorted by date, then by income/expense would be greatly helpful... in avoiding mini panic attacks ;). 
Comment 6 Josh Andler 2008-05-14 22:38:55 UTC
I hate to comment on the same bug again... but, as the original submitter commented, currently it can effectively show that you wouldn't have sufficient funds within a given day due to sorting order issues (my bank, and probably all banks, list credits before debits on statements and process transactions in the same fashion).

I know I winked a year ago in my comment, but it really can induce unnecessary stress when the projected minimum balance is inaccurate due to this sorting issue.

I can't tell you how much I love GnuCash, and this is honestly the only issue I've ever had with it.
Comment 7 Steven N. Severinghaus 2009-11-01 16:21:23 UTC
For me, it would be sufficient to have keyboard shortcuts to increment and decrement the entry time of the transaction by one second. This is essentially what I have to do when I edit the XAC file manually. If hidden functionality isn't acceptable, we could add "Bump forward" and "Bump backward" items under the "Transaction" menu.
Comment 8 Steven N. Severinghaus 2009-11-01 20:12:46 UTC
Created attachment 146693 [details] [review]
Menu items to bump transactions forward and backward in time by seconds
Comment 9 Steven N. Severinghaus 2009-11-01 20:13:58 UTC
Here's a patch against SVN head that adds the bump menu items I suggested. It seems to work.

The only thing I'm not confident about is the call I make to gnc_ppr_update_date_query(page) in order to refresh the register view. It doesn't seem to properly update the credit/debit/balance columns, though it does reorder the transactions properly, which at least gives you some immediate visual feedback. Is there a better way to go about that? Maybe I need to look at the code for the '+' and '-' shortcuts in the date-posted field.

(Apologies for the double-post. I apparently still don't understand bugzilla's interface...)
Comment 10 Steven N. Severinghaus 2009-11-01 20:26:51 UTC
Created attachment 146694 [details] [review]
Adds a menu item to bump a transaction forward one second

Upon thinking a little more about it, I realized that bumping a transaction forward is all I'd want to do. Bumping an unbumped transaction would send it back to the previous day, which would be undesirable.
Comment 11 Christian Stimming 2009-11-05 12:40:45 UTC
Comment on attachment 146694 [details] [review]
Adds a menu item to bump a transaction forward one second

Patch looks good. One issue though: Can you please find a better wording instead of "Bump"? Rather a more accounting-like wording? As a non-native speaker, words that come to mind are "Move txn forward", "Reorder txn forward" or something like that. In the source the word "bump" is fine theoretically, but if the word in the GUI is different, the GUI-word should also be used in the source to avoid potential confusion.
Comment 12 Steven N. Severinghaus 2009-11-05 20:03:44 UTC
You're right, it's not the most intuitive word. "Move" sounds too strong, as though it would change the date. Maybe "Shift txn forward"? I'll submit it with that change (to the GUI and the function names), if that's acceptable.

The main problem with this patch is that unless you know what it's doing behind the scenes, it will probably be confusing: it won't always reorder the transactions, unless you know that you should keep hitting it until you achieve the desired effect.

But querying the register for the date of the next transaction on the date of the current transaction sounded like more work than I was willing to do. Perhaps the patch's behavior is good enough if it's properly documented.
Comment 13 Steven N. Severinghaus 2009-11-07 01:14:04 UTC
Created attachment 147149 [details] [review]
Menu item to shift transaction forward

Here's the patch redone with "shift" instead of "bump".

Any idea how to get the ledger to redraw or recalculate the balance column? I've looked at other code and tried a few different functions (gnc_ledger_display_refresh, gnc_split_register_redraw, gnc_table_refresh_gui), but none of them do what is needed here.

I noticed that making any change to a transaction and hitting "enter" to save it causes the balance column to update. I'm just having trouble tracking down what I can call to do that.
Comment 14 Christian Stimming 2009-11-09 12:11:46 UTC
Comment on attachment 147149 [details] [review]
Menu item to shift transaction forward

Looks good. Regarding the balance column update: Unfortunately I also don't have any idea on how to fix that.
Comment 15 Phil Longstaff 2009-11-10 01:46:12 UTC
I think the running split balances are set by xaccAccountRecomputeBalance(), which goes though the splits in order and calculates the current, cleared and reconciled balances for that split.  The order is set via xaccAccountSortSplits() which uses the function xaccSplitOrder() in engine/split.c.

Do we really need to keep the running balances with the splits?  Are they used for anything other than display in the register?  If so, maybe their calculation should be moved out into the register code so that if a filter or sort order is set, the values can be recalculated correctly.

Note that xaccAccountGetBalanceAsOfDate() assumes the splits are in date order.
Comment 16 Christian Stimming 2009-11-20 19:58:15 UTC
Comment on attachment 147149 [details] [review]
Menu item to shift transaction forward

r18427, thanks a lot!
Comment 17 Christian Stimming 2009-11-29 16:13:48 UTC
Re comment #13: Unfortunately the menu item in the current form IMHO isn't a fully finished feature. The behaviour of the menu item is rather unclear: After clicking on it, nothing changes in the transaction, only after I additionally pressed "enter". After this, as you already said, the running balance isn't updated, which is additionally confusing. These two points would need to be fixed before we can recommend this feature for the next stable version 2.4.0; otherwise I'd rather comment out the C lines which add it to the menu so that the menu item wouldn't be there for 2.4.0.

Additionally, the menu item should be added to the right-click menu of the transactions, but this is probably rather easy.
Comment 18 Christian Stimming 2009-11-29 20:42:28 UTC
Menu item temporarily removed (commented-out) in r18450. Can be enabled again once the next release is out.
Comment 19 Christian Stimming 2011-03-29 08:37:12 UTC
This patch was not the correct approach. But instead the changes in SVN r20294 and r20306 implement the correct behaviour (for the invoice window) and "just" need to be copied over to the normal account register window.
Comment 20 John Ralls 2018-06-29 20:52:54 UTC
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=310567. Please continue processing the bug there and please update any external references or bookmarks.