We should probably detect this situation and not close books when we closed
the books before on the same date in that case, though.  Filing a bug
report on that.

On Mon, Oct 6, 2014 at 8:03 AM, Chris Travers <chris.trav...@gmail.com>
wrote:

>
>
> On Mon, Oct 6, 2014 at 6:21 AM, Stephen Winnall <st...@winnall.ch> wrote:
>
>> On 04.10.2014, at 23:26, Erik Huelsmann <ehu...@gmail.com> wrote:
>>
>> My books are closed after a year-end. I tried to reopen them. My browser
>>> says:
>>>
>>> Error!
>>>
>>> Access Denied
>>> More information has been reported in the error logs at LedgerSMB.pm
>>> line 775.
>>>
>>> dbversion: 1.4.2, company: my-company
>>>
>>> I get the following error in my PostgreSQL log:
>>>
>>> 2014-10-04 20:05:51 GMT ERROR:  permission denied for sequence
>>> account_checkpoint_id_seq
>>>
>>
>> Ok. Dealing with this one should not be too hard. If you log into your
>> database with psql, you should execute the following command:
>>
>>   grant USAGE, SELECT, UPDATE on account_checkpoint_id_seq to public;
>>
>>
>> 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.
>>
>
> 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.
>
>>
>> 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
>> Ledger-smb-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ledger-smb-users
>>
>>
>
>
> --
> Best Wishes,
> Chris Travers
>
> Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor
> lock-in.
> http://www.efficito.com/learn_more
>



-- 
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor
lock-in.
http://www.efficito.com/learn_more
------------------------------------------------------------------------------
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
Ledger-smb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users

Reply via email to