2018-09-12 14:48:59 -04:00
|
|
|
--------------------------relational ledger------------------------------------------
|
|
|
|
|
|
|
|
CREATE TABLE evt.gl (
|
|
|
|
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY
|
2018-09-17 23:42:01 -04:00
|
|
|
,bprid INT REFERENCES evt.bpr (id)
|
2018-09-20 22:28:24 -04:00
|
|
|
,acct ltree REFERENCES evt.acct (acct)
|
2018-09-19 00:58:06 -04:00
|
|
|
,pstmp timestamptz DEFAULT CURRENT_TIMESTAMP
|
|
|
|
--populates by trigger join to evt.fspr
|
|
|
|
,tstmp timestamptz
|
2018-09-20 20:16:32 -04:00
|
|
|
,fspr ltree REFERENCES evt.fspr (id)
|
2018-09-12 14:48:59 -04:00
|
|
|
,amount numeric (12,2)
|
2018-09-17 23:42:01 -04:00
|
|
|
,glline INT
|
|
|
|
,bprkeys JSONB
|
2018-09-12 14:48:59 -04:00
|
|
|
);
|
2018-09-17 23:42:01 -04:00
|
|
|
COMMENT ON COLUMN evt.gl.id IS 'gl id';
|
|
|
|
COMMENT ON COLUMN evt.gl.bprid IS 'id of initial basic pecuniary record';
|
2018-09-12 14:48:59 -04:00
|
|
|
COMMENT ON COLUMN evt.gl.acct IS 'account code';
|
2018-09-19 00:58:06 -04:00
|
|
|
COMMENT ON COLUMN evt.gl.pstmp IS 'post time stamp';
|
|
|
|
COMMENT ON COLUMN evt.gl.tstmp IS 'transaction time stamp';
|
|
|
|
COMMENT ON COLUMN evt.gl.fspr IS 'fiscal period';
|
2018-09-12 14:48:59 -04:00
|
|
|
COMMENT ON COLUMN evt.gl.amount IS 'amount';
|
2018-09-17 23:42:01 -04:00
|
|
|
COMMENT ON COLUMN evt.gl.glline IS 'gl line number';
|
|
|
|
COMMENT ON COLUMN evt.gl.bprkeys IS 'extract from initial basic pecuniary record';
|