On 04.10.2014, at 23:26, Erik Huelsmann <..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: Error! 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) FROM (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. Regards, Steve |
------------------------------------------------------------------------------ Slashdot TV. Videos for Nerds. Stuff that Matters. http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________ Ledger-smb-users mailing list ..hidden.. https://lists.sourceforge.net/lists/listinfo/ledger-smb-users