setting next invoice number (mysql system)

Phil Longstaff plongstaff at rogers.com
Mon Apr 19 11:50:50 EDT 2010


After I look at the code, the way I think it's *supposed* to work is:

1) invoice dialog asks business invoice object for the next invoice ID
2) invoice object asks book for next ID from counter "gncInvoice" ("gncBill" for a vendor bill, "gncExpVoucher" for employee expense item).
3) book checks if backend provides a counter method.  If not, it looks in book slot "counters/gncInvoice" and increments the value.

 
It does *not* save the value after it's been incremented, so this is a bug.

I'm planning to release 2.3.12 in the next day or so.  I should be able to include a fix for this.

Phil
---------
I used to be a hypochondriac AND a kleptomaniac. So I took something for it.




________________________________
From: Bill Neely <ceo at xantek.cc>
To: Maf. King <maf at chilwell.net>
Cc: gnucash-user at gnucash.org; Phil Longstaff <plongstaff at rogers.com>; Derek Atkins <warlord at mit.edu>
Sent: Mon, April 19, 2010 11:36:09 AM
Subject: Re: setting next invoice number (mysql system)

Maf:

Good idea, but I already tried it. Only thing that shows up is some 
entries in the slots table described as "gncInvoice/invoice-guid".

Not sure what these are, but they dont seem to contain the invoice counter.


Bill

http://business-phones.us A professional phone system for your business. Bypass the "phone company'.


On 4/19/2010 12:07 AM, Maf. King wrote:
> On Saturday 17 April 2010 19:38:35 Bill Neely wrote:
>    
>> Maybe the fact that you were converting an existing xml data file?????
>> Ours is a totally clean installation of 2.3.11
>>      
> Maybe some (inadvertent) change in 2.3.9 ->  2.3.11?
>
> TBH, I looked in the slots table and couldn't see it at first.  Figuring that
> it _had_ to be somewhere in the db, I looked in various other tables and
> eventually found the counters by doing a grep on the files in the database
> directory.  ( probably something like grep -i invoice *)
>
> Got a "Binary file slots.MYD matches" result, and looked more closely at that
> table with the MySQL command line.
>
> HTH,
> Maf.
>
>
>    
>> One thing I have determined is that there is definitely a counter
>> somewhere, since the invoices do auto increment a number starting with
>> 0000001. We have two companies that we are setting up. And when I load
>> the second company database, I get a new set of numbers, so they have to
>> be in the mysql file somewhere, I think.
>>
>> Hope this info is helpful to someone.
>>
>>
>> Bill
>>
>> http://business-phones.us A professional phone system for your business.
>> Bypass the "phone company'.
>>
>> On 4/17/2010 1:22 AM, Maf. King wrote:
>>      
>>> On Saturday 17 April 2010 02:15:00 Phil Longstaff wrote:
>>>        
>>>> To tell you the truth, I don't know how I store it either.  It's
>>>> possible that it is being stored in the slots which works fine for XML
>>>> because when you write the file, the book and its slots are written.
>>>> For SQL, however, the call writing the slots needs to be surrounded by
>>>> gnc_book_begin_edit()/gnc_book_commit_edit() to force an update.  I'll
>>>> check it out.
>>>>
>>>>    Phil
>>>>          
>>> Hi,
>>>
>>> I haven't done much with any 2.3.x releases yet, just a bit of
>>> experimenting. I did installed 2.3.9 (I think) and opened an existing
>>> 2.2.9 data file, which contained invoices.  The gncInvoice counter exists
>>> in the slots table in the MySQL db which resulted.
>>>
>>> Not sure if the OP is starting from a new db or an XML file.
>>>
>>> Maf.
>>>        
>    


More information about the gnucash-user mailing list