<html>
<head>
</head>
<body class='hmmessage'><div dir='ltr'>


<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
<div dir="ltr">I'd like to post a patch for the calculation of the next check number in the Transaction Editor form.<br>When
 you enter eg. "2012.001" as a check number, the next check number will 
be ""2012.2" in the current version (4.6.90-8be3581932).<br>The patch makes the next check number "2012.002".<br><br>----------- CUT HERE ----<br>--- /home/hw/kmymoney2/kmymoney-orig/kmymoney/kmymoneyutils.cpp    2012-01-14 13:27:17.029665048 +0100<br>+++ /home/hw/kmymoney2/kmymoney/kmymoney/kmymoneyutils.cpp    2012-01-14 17:14:38.643054307 +0100<br>@@ -354,9 +354,17 @@<br> {<br>   // determine next check number<br>   QString number;<br>-  QRegExp exp(QString("(.*\\D)?(\\d+)(\\D.*)?"));<br>+  QRegExp exp(QString("(.*\\D)?(0*)(\\d+)(\\D.*)?"));<br>   if (exp.indexIn(acc.value("lastNumberUsed")) != -1) {<br>-    number = QString("%1%2%3").arg(exp.cap(1)).arg(exp.cap(2).toULongLong() + 1).arg(exp.cap(3));<br>+    QString arg1 = exp.cap(1);<br>+    QString arg2 = exp.cap(2);<br>+    long    arg3 = exp.cap(3).toULongLong() + 1;<br>+    QString arg4 = exp.cap(4);<br>+   
 if (arg2.length() > 0 && arg1.length() + arg2.length() + 
QString::number(arg3).length() + arg4.length() != 
acc.value("lastNumberUsed").length())<br>+    {<br>+      // new string is bigger than old one -> remove one preceding zero<br><br>+      arg2 = arg2.mid(1);<br><br>+    }<br>+    number = QString("%1%2%3%4").arg(arg1).arg(arg2).arg(arg3).arg(arg4);<br>   } else {<br>     number = '1';<br>   }<br>----------- CUT HERE ----<br><br>Kind regards,<br><br>HW<mytubeelement savebandwidth="false" enablefullscreen="true" onlynotification="false" fshd="false" quality="small" autoplayonsmartbuffer="true" autoplayonbufferpercentage="42" autoplayonbuffer="false" autobuffer="false" autoplay="false" hidepopup="false" loop="false" enable="true" soundnotification="true" desktopnotification="true" id="myTubeElement"><bundle any_moment="Any Moment" sec="Sec" min="Min" hr="Hr" stopped="Stopped" completed="Completed" will_start_playing_when_initialized="Will start playing when initialized" will_start_buffering_when_initialized="Will start buffering when initialized" waiting="Waiting" calculating="Calculating" adblock_interferance_message="Adblock (or similar extension) is known to interfere with SmartVideo. Please add this url to adblock whitelist." error="Error" notification_status_delimitor=";" desktop_notification_denied="You have denied permission for desktop notification for this site" click_to_enable_for_this_site="Click to enable for this site" off="Off" on="On" not_supported="Not Supported" buffered_message="The video has been buffered as requested and is ready to play." hyphen="-" buffered="Buffered" video_buffered="Video Buffered" no_notification_supported_on_your_browser="No notification style supported on your browser version" global_preferences="Global Preferences" estimated_time="Estimated Time" only_notify="Only Notify" loop="Loop" continuation_on_next_line="-" desktop_notification="Desktop Notification" sound="Sound" start_playing_when_buffered="Start playing when buffered" smart_buffer="Smart Buffer" percentage="%" label_delimitor=":"></bundle></mytubeelement></div>
<mytubeelement savebandwidth="false" enablefullscreen="true" onlynotification="false" fshd="false" quality="small" autoplayonsmartbuffer="true" autoplayonbufferpercentage="42" autoplayonbuffer="false" autobuffer="false" autoplay="false" hidepopup="false" loop="false" enable="true" soundnotification="true" desktopnotification="true" id="myTubeElement"><bundle any_moment="Any Moment" sec="Sec" min="Min" hr="Hr" stopped="Stopped" completed="Completed" will_start_playing_when_initialized="Will start playing when initialized" will_start_buffering_when_initialized="Will start buffering when initialized" waiting="Waiting" calculating="Calculating" adblock_interferance_message="Adblock (or similar extension) is known to interfere with SmartVideo. Please add this url to adblock whitelist." error="Error" notification_status_delimitor=";" desktop_notification_denied="You have denied permission for desktop notification for this site" click_to_enable_for_this_site="Click to enable for this site" off="Off" on="On" not_supported="Not Supported" buffered_message="The video has been buffered as requested and is ready to play." hyphen="-" buffered="Buffered" video_buffered="Video Buffered" no_notification_supported_on_your_browser="No notification style supported on your browser version" global_preferences="Global Preferences" estimated_time="Estimated Time" only_notify="Only Notify" loop="Loop" continuation_on_next_line="-" desktop_notification="Desktop Notification" sound="Sound" start_playing_when_buffered="Start playing when buffered" smart_buffer="Smart Buffer" percentage="%" label_delimitor=":"></bundle></mytubeelement>                                           </div></body>
</html>