Topic: Invoice reference

Hi,

Where is the invoice reference stored in the database? I've deleted some test invoices from the database using phpmyadmin, but I can't use the original invoice reference anymore because it is allready used.

Thanks.

Re: Invoice reference

At first I thought it was that simple...

There is many tables, some with auto-increment (debtor_trans_details, etc), some are indirectly referred by sys_types (debtor_trans). For every type of transaction, the next reference is kept there.

If you want an idea, you can use PHPMyadmin to look at it, or just look inside the a backup file to get another view.

You can also take a look at the Entity Relationship (ER) Diagram for FrontAccounting 2.2 , https://frontaccounting.com/wbt/pages/download/download-documentations.php

At first I thought it was simple...Powerfull softwares are often complex.

Gaston

Re: Invoice reference

References are stored in transaction tables with a couple of exceptions. When transaction table  does not have any reference field, this is stored in refs table.
Look in get_systype_db_info() function in references.inc file for more information. The uniqueness of reference is checked with is_new_reference() method (see references.inc).
NB the db scheme in this aspect is rather effect of long application history, than some sophisticated design.
Janusz