Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding GLSession addJournal() #215

Merged
merged 1 commit into from
May 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion modules/minigl/src/main/java/org/jpos/gl/GLSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,20 @@ public void addChart (Account acct)
session.save (acct);
}

/**
* Add a Journal
* Check permissions.
*
* @param j The new Journal
* @throws HibernateException on error
* @throws GLException if user doesn't have write permission
*/
public void addJournal (Journal j) throws HibernateException, GLException
{
checkPermission (GLPermission.WRITE);
session.save (j);
}

/**
* @param chart chart of accounts.
* @param code account's code.
Expand Down Expand Up @@ -1529,7 +1543,7 @@ public void lock (Journal journal, Account acct)
*/
public synchronized Session open () throws HibernateException {
return db.open();
}
}
/**
* Close underlying Hibernate session.
* @throws HibernateException
Expand Down