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

Re: Posting Invoices failing





On Nov 29, 2007 2:42 PM, BeamEnds <..hidden..> wrote:
Hi All,
if I create a Sales Invoice and Post it I get this:

DBD::Pg::st execute failed: ERROR: insert or update on table "acc_trans"
violates foreign key constraint "acc_trans_chart_id_fkey"
DETAIL: Key (chart_id)=(4000) is not present in table "chart".

Error!

INSERT INTO acc_trans
(trans_id, chart_id, amount,
transdate, project_id, invoice_id)
VALUES (?, ?, ?, ?, ?, ?)
ERROR: insert or update on table "acc_trans" violates foreign key
constraint "acc_trans_chart_id_fkey"
DETAIL: Key (chart_id)=(4000) is not present in table "chart".

Something is referencing an account with an id of 4000. And that account doesn't exist.  This may have to do with a part on that invoice. 

When this occurs, we refuse to do the insert (this avoids things like having your books out of balance due to money going into/out of an unknown account).

Best Wishes,
Chris Travers