[GNC] gncJobNextID in gncJob.c not in gncJob.h

Robert Simmons rsimmons0 at gmail.com
Mon Aug 8 09:32:14 EDT 2022


> unless your script is going to create jobs and immediately exit

Yes. I see no other way to do this other than directly changing the
database. There is nothing in the Python bindings that can do it. I'm
keeping a count "job_num" that I'm using with "str(job_num).zfill(6)" to
make it look correct for the statement that creates each job:

job = gnucash.gnucash_business.Job(book, str(job_num).zfill(6), cust,
job_name)
job_num += 1

Then after all jobs have been entered:

s.save()
s.end()
con = sqlite3.connect(target)
cur = con.cursor()
cur.execute(f'UPDATE slots SET int64_val = {job_num} WHERE name =
"counters/gncJob"')
con.commit()
con.close()


More information about the gnucash-user mailing list