Bug 343106 - Numbering system in the ledger.
Summary: Numbering system in the ledger.
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.7.1
Platform: unspecified Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-21 02:14 UTC by Rowland
Modified: 2015-03-29 17:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.2


Attachments
Patch to fix problem. (6.83 KB, patch)
2015-03-11 12:18 UTC, allan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rowland 2015-01-21 02:14:52 UTC
For some reason I keep getting the message that the transaction number in the ledger has already been used and do I want to use the next number. I have always agreed with that  but sometimes the problem is that I get the message that KMyMoney is not responding, and I have to ultimately close the program and restart. At other times the program keeps working without any problems.
There must be a bug in the system that is causing KMyMoney to crash when trying to allocate a number to each transaction.

Reproducible: Sometimes

Steps to Reproduce:
1.Start KMyMoney
2.Go to Ledger
3.Try and enter a transaction.

Actual Results:  
No change. KMyMoney tries to find a number for the transaction. Also The numbering system is definitely not consecutive as it should be.

Expected Results:  
The system should follow the proper numbering system for every transaction entered.
Comment 1 allan 2015-01-21 11:52:37 UTC
There are a few points here.

Firstly, for the crashes - it is unlikely that a crash can be debugged just from a statement that it crashed.  If at all possible, identify the exact steps leading up to the crash.  Also, have a look at https://techbase.kde.org/Projects/KMyMoney#Obtain_a_useful_backtrace_on_Windows, for information on getting a backtrace showing the lead up to the crash.  There is a link to the necessary debug info on that page, but it is out of date.  Get it from http://sourceforge.net/projects/kmymoney2/files/KMyMoney-Windows/4.7.1/.

So far as cheque numbering is concerned, I have noticed the puzzling message you mention.  In my case, it occurs at start-up when updating any schedules.  The reason for this is that the code is written to produce the message for a debit, but doesn't take account of the payment method, which should be only for payment by cheque, and not for any other means.  I did start to look into that, but need to go back to it.

If it's not too incinvenient, you can disable the automatic numbering.  Go to Settings>Configure KMM.  On the left, select Ledger, then Data entry.  There untick the auto-increment cheque number option.

On the numbering system not being consecutive, in the ledger for the account in question, right click on the column header, and you will see two boxes.  Unclick Use default, then, in the left box, click Number, then the right-arrow.  Number will now show in the right-hand box, but at the bottom.  Select it, then click the up-arrow until it is the top entry. Then click OK.  Now go back to the ledger for the account in question,.  Now, all the entries with cheque numbers will appear at the top(or bottom, depending on the scrollbar position.)  Check to see if there are any odd number entries there and correct them.  There may be breaks in the numbering, if a new cheque book is started, but the automatic numbering should work from the highest entry number.

If there is still a problem, try to work out what gives rise to it.  See how you get on with that lot.
Allan
Comment 2 Rowland 2015-01-21 23:56:35 UTC
Hi Allen,
Thanks for your help. I have set your suggestion in motion hopefully 
that it will work. I am not that good with these type of things so may 
need help if the problem arises again.
Thanks
Rowland

On 21/01/2015 22:22, allan wrote:
> https://bugs.kde.org/show_bug.cgi?id=343106
>
> allan <agander93@gmail.com> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>       Ever confirmed|0                           |1
>                   CC|                            |agander93@gmail.com
>               Status|UNCONFIRMED                 |CONFIRMED
>
> --- Comment #1 from allan <agander93@gmail.com> ---
> There are a few points here.
>
> Firstly, for the crashes - it is unlikely that a crash can be debugged just
> from a statement that it crashed.  If at all possible, identify the exact steps
> leading up to the crash.  Also, have a look at
> https://techbase.kde.org/Projects/KMyMoney#Obtain_a_useful_backtrace_on_Windows,
> for information on getting a backtrace showing the lead up to the crash.  There
> is a link to the necessary debug info on that page, but it is out of date.  Get
> it from
> http://sourceforge.net/projects/kmymoney2/files/KMyMoney-Windows/4.7.1/.
>
> So far as cheque numbering is concerned, I have noticed the puzzling message
> you mention.  In my case, it occurs at start-up when updating any schedules.
> The reason for this is that the code is written to produce the message for a
> debit, but doesn't take account of the payment method, which should be only for
> payment by cheque, and not for any other means.  I did start to look into that,
> but need to go back to it.
>
> If it's not too incinvenient, you can disable the automatic numbering.  Go to
> Settings>Configure KMM.  On the left, select Ledger, then Data entry.  There
> untick the auto-increment cheque number option.
>
> On the numbering system not being consecutive, in the ledger for the account in
> question, right click on the column header, and you will see two boxes.
> Unclick Use default, then, in the left box, click Number, then the right-arrow.
>   Number will now show in the right-hand box, but at the bottom.  Select it,
> then click the up-arrow until it is the top entry. Then click OK.  Now go back
> to the ledger for the account in question,.  Now, all the entries with cheque
> numbers will appear at the top(or bottom, depending on the scrollbar position.)
>   Check to see if there are any odd number entries there and correct them.
> There may be breaks in the numbering, if a new cheque book is started, but the
> automatic numbering should work from the highest entry number.
>
> If there is still a problem, try to work out what gives rise to it.  See how
> you get on with that lot.
> Allan
>
Comment 3 allan 2015-02-08 22:46:06 UTC
I done quite a bit of testing over the last couple of days, but experienced no crashes.

I've found a couple of bugs though, the fixes for which I'll continue testing for a while longer.  In two places,  the payment method was being incorrectly set - check payment instead of direct debit, which gave rise to the inappropriate 'check number already used' message.  Also, I've added the schedule name to the message that may appear during schedule checking at startup, and when editing.
Comment 4 allan 2015-03-11 12:18:46 UTC
Created attachment 91531 [details]
Patch to fix problem.
Comment 5 allan 2015-03-11 12:21:09 UTC
Assuming no adverse comment, I'll commit in a week or so.
Comment 6 allan 2015-03-19 13:47:45 UTC
Git commit 71bbf7b53125edfd37047f0bdba1feedd88a6d26 by Allan Anderson.
Committed on 08/02/2015 at 22:09.
Pushed by allananderson into branch 'master'.
Fix unhelpful messages when processing schedules at startup.
Fix 'next check number' message when updating a schedule for a
non-checking schedule type.

M  +2    -0    kmymoney/dialogs/keditscheduledlg.cpp
M  +2    -0    kmymoney/dialogs/kenterscheduledlg.cpp
M  +15   -4    kmymoney/dialogs/transactioneditor.cpp
M  +3    -0    kmymoney/dialogs/transactioneditor.h
M  +1    -2    kmymoney/kmymoney.cpp

http://commits.kde.org/kmymoney/71bbf7b53125edfd37047f0bdba1feedd88a6d26
Comment 7 allan 2015-03-20 23:07:44 UTC
Git commit ea9a548272903ec657993eba011c6e72695d632d by Allan Anderson.
Committed on 08/02/2015 at 22:09.
Pushed by allananderson into branch '4.7'.
Fix unhelpful messages when processing schedules at startup.
Fix 'next check number' message when updating a schedule for a
non-checking schedule type.

(cherry picked from commit 71bbf7b53125edfd37047f0bdba1feedd88a6d26)

Conflicts:
	kmymoney/kmymoney.cpp

M  +2    -0    kmymoney/dialogs/keditscheduledlg.cpp
M  +2    -0    kmymoney/dialogs/kenterscheduledlg.cpp
M  +15   -4    kmymoney/dialogs/transactioneditor.cpp
M  +3    -0    kmymoney/dialogs/transactioneditor.h
M  +0    -1    kmymoney/kmymoney.cpp

http://commits.kde.org/kmymoney/ea9a548272903ec657993eba011c6e72695d632d