At month-end close, all JOURNAL entries are moved to the GHIS table. (Additionally, any
standard entries in GSTD are created in the new period, and any entries marked with a
REVERSAL flag are copied to the new period with their amounts reversed).
Each ―set‖ of journal entries is identified by a combination of PERIOD/ REF/ SOURCE/
SITEID. Within each set of entries, the ITEM field counts from 1 to x. There cannot be
more than 32767 lines in a journal entry.
Within any given journal entry, the AMT column should always add up to 0, because debits
(positive) should equal credits (negative).
GHIS has a special flag, BALFOR, which indicates if the activity is to be recorded in the
"balance forward period", sometimes called the 13th period. Balance forward entries are
recorded after the year-end period, and before the year-open period. The actual value of
PERIOD is the same as the year-open period (i.e. January). During the GL year-end close,
the year-end balance is computed for each account and entered in the balance forward period
in GHIS. Any year-end closing activity, such as closing P&L accounts to retained earnings,
or other closing accounts as indicated in GCLS, are also made in the balance forward period.
Some useful queries:
Show all journal entries for a given account:
SELECT * FROM JOURNAL WHERE ACCTNUM=’MR1000111’ AND ENTITYID=’100’
AND BASIS=’A’
Show the balance forward activity for a given account:
SELECT * FROM GHIS WHERE ACCTNUM=’MR1000111’ AND ENTITYID=’100’ AND
BASIS=’A’ AND PERIOD=’200601’ AND BALFOR=’B’
Find any journal entry that is out of balance:
SELECT PERIOD, REF, SOURCE, SITEID, SUM(AMT) FROM JOURNAL GROUP BY
PERIOD, REF, SOURCE, SITEID HAVING SUM(AMT)<>0
GLSUM
All activity entered into JOURNAL or GHIS is accumulated into balances in GLSUM by
ACCTNUM, ENTITYID, PERIOD, BASIS, and DEPARTMENT.
A valid account from GACC
A valid entity from ENTITY
A valid department from GDEP
B for balfor balances, N for