[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: At the end of my teather with LSMB



On Tue, May 27, 2008 at 6:26 PM, Stroller
<..hidden..> wrote:
>
> On 27 May 2008, at 20:05, ..hidden.. wrote:
>>
>> Thanks, I've just done that but it turns out that I do have a
>> duplicate invoice number.  I do have a gap directly below it, though,
>> so I can just change invnumber.
>>
>> Before I do that, is there anywhere else I will need to change it,
>> apart from ar?
>
> I believe there is.
>
> What I have done in the past when dealing with a similar SNAFU is to
> look at the output of pg_dumpall (I have this emailed to me daily for
> backup purposes) and grep for the number in question.

I can assure you the only place a specified AR invoices number is in
ar.  There is also a sinumber setting in defaults which you could
adjust back if you don't want a gap, but that is all that is strictly
required.

ar.id is found in multiple other tables (you could be confusing
invnumber and id).  In that case, invoice, audit_trail, inventory, and
acc_trans would need to be looked at too, but duplicate ID's are not
only REALLY bad, but should never ever occur in LSMB 1.2 or higher.
Furthermore, if you have to touch the transaction id's, all I can say
is, "please don't."
>
> If I'm correct that the number is stored in two places (in two
> tables?) then it should be fairly obvious.
>
> When I dealt with this myself, I just edited the pgdumpall-out.txt
> file, then dropped and reloaded my Ledger-SMB database completely.
> You may be more familiar with `psql` than I am, but for those of us
> who use it very rarely this is, IMO, the easiest way.

It is not a bad way to get started understanding the db schema (but
probably better to ask for confirmation before making many changes),
but if psql is the only issue, use pgAdmin instead.

Best Wishes,
Chris Travers