« Return to Thread: autoincrementing invoices numbers

Re: autoincrementing invoices numbers

by Nathan Gray :: Rate this Message:

Reply to Author | View in Thread


On 7-May-09, at 1:45 AM, <cotanda@...> <cotanda@...>  
wrote:

> ...I put some code on the RecivabloInvoice function post... it's only
> executed sometimes. ...

Weird.  Sorry, no tips for that.


>> I think you lost me.  Could you spell it out with an example?
>
> For example, you create three new invoices: 09-001, 09-002, 09-003.
>    a) Posting 09-003 will cause it to be renamed to 09-001 and the
> formerly "09-001" would be renamed to 09-003.
>    b) Deleting 09-002 will cause the actual "09-003" to change its  
> number
> to "09-002"

I don't think you can do that.
It's a bad idea in Canada (confusion), and may be illegal in some  
places.

>    c) Once an invoice has reached "posted" status (for example
> "PostedReceivableInvoice") it will remain with its numbering... but  
> since
> that the number may change. I think that way you could avoid "jumping"
> numbers... but its always under the assumption than an invoice "only  
> gets
> serious" (gets it's real number) when posting it.
>
> That is what I think it's a weird solution, and I don't know if it is
> really a solution or it's only messing around with no benefit (if it's
> necessary a solid numbering for non posted invoices it would not be a
> solution at all).

I invite others to add their thoughts at this point, but what if:
1.  After an invoice is posted, no changes (current)
2.  If an un-posted invoice is cancelled, its number is still consumed
3.  Cancelled invoices are kept, so you know where the number went,  
and can see that it is permanently cancelled, and not posted

Keeping cancelled invoices would get around the problem of numbers  
disappearing.  We don't have to worry about jumps, because even if the  
invoices are posted out of order all the numbers are still there.

There is still a possible edge case that needs attention:
1.  Two new invoices, A & B, are created, but not yet saved.
2.  Both get the number 09-004
3.  A is saved with 09-004
4.  A new invoice, C is created with number 09-005
5.  C is saved with 09-005
*6* B is saved, and before saving (only for the first time) its number  
should be updated to 09-006.


Would that solve the weirdness?  Numbers won't jump around, they won't  
disappear, and with the exception of that edge case, they will be  
absolutely sequential.


Nathan Gray
nathan at goarctic dot com


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Perp-developers mailing list
Perp-developers@...
https://lists.sourceforge.net/lists/listinfo/perp-developers

 « Return to Thread: autoincrementing invoices numbers