« Return to Thread: autoincrementing invoices numbers

Re: autoincrementing invoices numbers

by Nathan Gray :: Rate this Message:

Reply to Author | View in Thread


On 30-Apr-09, at 1:52 AM, <cotanda@...>  
<cotanda@...> wrote:

> Oooops! I didn't see that one coming...
> It works fine in my enterprise because we only need (for the moment)  
> AR,
> but the thing is it should respect each type. When you say "specific
> sequences in egw_nextid"... what do you mean? A global variable or so?

A global variable would not persist or be available for everyone.
eGroupWare provides a table, egw_nextid, that lets you store the next  
number in a particular sequence.
So if we use an appname like 'perp_ar:invoice', (and perp_ap:invoice')  
and update the ID column for every invoice, that should work.

The trick is when to update that ID.  Every time a new invoice is  
created?  If the invoice is cancelled instead of posted, you'll get a  
missing invoice number.  Some countries have problems with that (it's  
illegal).  If you update the number when saved or posted, there is the  
possibility of duplicates in a multi-user system.  Duplicates can be  
dealt with, of course, by just checking and trying the next ID in order.

> It would't be desirable a field on the table that indicates which  
> kind of
> invoice are you working with??

Not a bad idea.  It's something I've been considering for Orders, so  
maybe its something that should be done for both Orders and Invoices.  
It's not something that has been needed until now, because there's  
only 2 types, AP and AR, and it's easy to tell the difference based on  
the supplier_id & client_id.

Thanks for looking into this.

Nathan Gray
nathan at goarctic dot com


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Perp-developers mailing list
Perp-developers@...
https://lists.sourceforge.net/lists/listinfo/perp-developers

 « Return to Thread: autoincrementing invoices numbers