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

Re: Problems with 1.4.2

On 06.10.2014, at 17:03, Chris Travers <..hidden..> wrote:

Thanks for this. It got me to the next stage. But when I try to reopen the books, I get the following message:


Conflict with Existing Data. Perhaps you already entered this?
More information has been reported in the error logs at LedgerSMB.pm line 775.

and the PostgreSQL log shows:

2014-10-06 13:15:42 GMT ERROR:  duplicate key value violates unique constraint "account_checkpoint_pkey"
2014-10-06 13:15:42 GMT DETAIL:  Key (end_date, account_id)=(2011-09-30, 43) already exists.
2014-10-06 13:15:42 GMT CONTEXT:  SQL statement "INSERT INTO 
                account_checkpoint (end_date, account_id, amount, debits, credits)
            SELECT in_end_date, COALESCE(a.chart_id, cp.account_id),
                    COALESCE(SUM (a.amount),0) + coalesce(MAX (cp.amount), 0),
                    COALESCE(SUM (CASE WHEN (a.amount < 0) THEN a.amount ELSE 0 END), 0) +
                     COALESCE( MIN (cp.debits), 0),
                    COALESCE(SUM (CASE WHEN (a.amount > 0) THEN a.amount ELSE 0 END), 0) +
                     COALESCE( MAX (cp.credits), 0)
                (SELECT * FROM acc_trans WHERE transdate <= in_end_date AND
                 transdate > COALESCE(cp_date, '1200-01-01')) a
                FULL OUTER JOIN (
                        select account_id, end_date, amount, debits, credits 
                        from account_checkpoint
                        WHERE end_date = cp_date
                        ) cp on (a.chart_id = cp.account_id)
                group by COALESCE(a.chart_id, cp.account_id)"
        PL/pgSQL function eoy_create_checkpoint(date) line 27 at SQL statement
        SQL function "eoy__reopen_books_at" statement 2
2014-10-06 13:15:42 GMT STATEMENT:  SELECT * FROM "public"."eoy__reopen_books_at"('2011-10-01')

It looks to me as though “reopen books” is trying to repeat the existing “close books” entry.

Are you trying to reopen to another date when the books were originally closed?  Try re-opening to a date shortly after if you can.

That isn't a closing books entry in the sense of zeroing out temporary accounts.  It is instead a summary record of where the books are on the date they are closed. 

My expertise is open source software rather than bookkeeping!

The books were closed on 2011-09-30 and I tried to reopen them per 2011-10-01. That’s the end of my year. I’ve done all the deferred charges (? - transitory bookings?) thingies and actually booked all of the subsequent year. I think I can proceed without reopening the books.


Slashdot TV.  Videos for Nerds.  Stuff that Matters.
Ledger-smb-users mailing list