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

Re: Change description of gl transaction.



Hi Arne,

On Sun, Mar 27, 2016 at 7:01 PM, Arne Hanssen <..hidden..> wrote:
Is it possible to change the description of an entry in the gl table?
Seems like this has change some time ago.  I'm using 1.3.47 and I get
this error:

# UPDATE gl SET description='Kont. Arne H.' WHERE id='630';

Whether or not you can change a description of a transaction (GL, AR or AP) depends on two things:

1. The 'audit trail' setting being enabled or not
2. The database user you're using to change the description

If the 'audit trail' functionality is enabled, the database will log all changes to accounting tables to audit trail tables. In order to attribute that to specific users (employees), the user making the change needs to exist as a
 
ERROR:  null value in column "person_id" violates not-null constraint
DETAIL:  Failing row contains (630, gl, 16-031, null, UPDATE, 2016-03-27
17:45:33.702631, null, 2398).
CONTEXT:  SQL statement "INSERT INTO audittrail
(trans_id,tablename,reference, action, person_id)
values (t_row.id,TG_RELNAME,t_reference, TG_OP, person__get_my_entity_id())"
PL/pgSQL function gl_audit_trail_append() line 19 at SQL statement

What the server is "telling" you is that the user you're using to change the GL item doesn't exist as an employee in the database. E.g. if your 'postgres' user isn't an employee (which it normally isn't), and you log into your DB with the postgres user, then the above error will occur.

To summarize: there are 2 ways to change the description without getting the error:

 (a) turn off (temporarily) the audit trail - definitely not a good solution
 (b) use a database user which is also an employee (DEFINITELY the preferred solution).

 

The contents is this:

# select * from gl where id='630';

  id  | reference |    description    | transdate  | person_id | notes |
approved | department_id
-----+-----------+-------------------+------------+-----------+-------+----------+---------------
  630 | 16-031    | Kont. Arnstein I. | 2016-03-11 | |       | t
|             0
(1 row)


The content of the transaction isn't related to the problem you're seeing. Any other transaction would have given you the same problem.


Hope that helps!


--
Bye,

Erik.

http://efficito.com -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Ledger-smb-users mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users