about check number heuristics
Derek Atkins
warlord at MIT.EDU
Thu Jan 25 09:37:42 EST 2007
Are you offering to code this and send in a patch? :-D
-derek
Chris <cxl000 at hotmail.com> writes:
> Here is a possible solution.
> assumption: if the numeric part overflows then we are likely to be onto
> a new cheque book and will have the manualy correct the cheque number so
> it does not matter what we produce. e.g. 999 => 1000, 0A999 => 0A1000
>
> There are 3 cases
> 1) the string is numeric with 0 or more leading 0's. e.g. 00123, 999
> 2) the string contian non numeric prefix. e.g. 0A999
> 3) the string is non numeric. e.g. ABC
>
> Case 1:
> use length if cheque number string to format length of printed
> number
> format namber with leading 0's
> increment the number
> Case 2:
> extract the non numeric prefix.
> increment the number
> print the prefix followed by the number
> Case 3:
> This is probably not a cheque number so search back until you find
> one that meets case 1 or case 2.
> If you cant find a suitable candidate treat it as a degenerate form
> of Case 2. e.g. "ABC" => "ABC" 0 => ABC1
>
> Regards,
> Chris
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-devel
mailing list