« Return to Thread: autoincrementing invoices numbers

Re: autoincrementing invoices numbers

by cotanda :: Rate this Message:

Reply to Author | View in Thread

Hi, sorry for being so late, I was on holidays xD

> 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.

I have a concern about the egw_nextid table. You should start from 0
everytime you make a new installation or, if you want to have an initial
number, you should add a field on the ar (and ap, etc) site configuration
menu. Having a type field on the database would be not much space (and I
guess not much work) and you will be able to specify the initial invoice
number just puting manually the first one (and if not, it would
automatically  be 0). So on you will also have all the invoices clasified
for further uses (I can't imagine right now, but I guess i could be usefull
to have the option). The bad news on changing the database is that all the
insert queries should be changed to add the new field, but I guess I would
capable of that xD. What do you think it would be more desirable? I would
try with the egw_nextid while I wait for answer ^^

Thanks for all
Jose


On Thu, 30 Apr 2009 08:29:31 -0600, Nathan Gray <nathan@...>
wrote:

> 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