public class AccountingService
extends java.lang.Object
Constructor and Description |
---|
AccountingService(MambuAPIService mambuAPIService)
Create a new accounting service
|
Modifier and Type | Method and Description |
---|---|
com.mambu.accounting.shared.model.GLAccount |
getGLAccount(java.lang.String glCode)
Requests a gl account by its gl code
|
com.mambu.accounting.shared.model.GLAccount |
getGLAccount(java.lang.String glCode,
java.lang.String fromDate,
java.lang.String toDate)
Requests a gl account by its gl code with a balance over a certain date range
|
java.util.List<com.mambu.accounting.shared.model.GLAccount> |
getGLAccounts(com.mambu.accounting.shared.model.GLAccountType accountType)
Requests gl accounts by account type
|
java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> |
getGLJournalEntries(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints,
java.lang.String offset,
java.lang.String limit)
Get GL journal entries by specifying filter constraints
|
java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> |
getGLJournalEntries(java.lang.String branchId,
java.util.Date fromDate,
java.util.Date toDate)
Returns all GLJournalEntries of a specific date-range, using default limits.
|
java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> |
getGLJournalEntries(java.lang.String branchID,
java.util.Date fromDate,
java.util.Date toDate,
java.lang.Integer offset,
java.lang.Integer limit)
Returns all GLJournalEntries of a specific date-range
|
java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> |
postGLJournalEntries(java.util.List<ApiGLJournalEntry> entries,
java.lang.String branchId,
java.lang.String date,
java.lang.String notes)
Post GL Journal Entries
|
java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> |
postGLJournalEntries(java.util.List<ApiGLJournalEntry> entries,
java.lang.String branchId,
java.lang.String date,
java.lang.String notes,
java.lang.String transactionId)
Post GL Journal Entries
|
@Inject public AccountingService(MambuAPIService mambuAPIService)
mambuAPIService
- the service responsible with the connection to the serverpublic com.mambu.accounting.shared.model.GLAccount getGLAccount(java.lang.String glCode) throws MambuApiException
glCode
- accounts's gl codeMambuApiException
public com.mambu.accounting.shared.model.GLAccount getGLAccount(java.lang.String glCode, java.lang.String fromDate, java.lang.String toDate) throws MambuApiException
glCode
- gl code. Must not be nullMambuApiException
public java.util.List<com.mambu.accounting.shared.model.GLAccount> getGLAccounts(com.mambu.accounting.shared.model.GLAccountType accountType) throws MambuApiException
accountType
- account type. Must not be nullMambuApiException
public java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> getGLJournalEntries(java.lang.String branchId, java.util.Date fromDate, java.util.Date toDate) throws MambuApiException
branchId
- branch IdfromDate
- range starting fromtoDate
- range ending atMambuApiException
- in case of an errorpublic java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> getGLJournalEntries(java.lang.String branchID, java.util.Date fromDate, java.util.Date toDate, java.lang.Integer offset, java.lang.Integer limit) throws MambuApiException
branchID
- branch IdfromDate
- range starting from. Must not be nulltoDate
- range ending at. Must not be nulloffset
- offset to start pagination. If null, the default value of 0 (zero) will be used.limit
- page-size. If null, the default value of 50 (fifty) will be used.MambuApiException
- in case of an errorpublic java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> getGLJournalEntries(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints, java.lang.String offset, java.lang.String limit) throws MambuApiException
filterConstraints
- filter constraints. Must not be nulloffset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
public java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> postGLJournalEntries(java.util.List<ApiGLJournalEntry> entries, java.lang.String branchId, java.lang.String date, java.lang.String notes) throws MambuApiException
entries
- a list of entries with the GL transaction details. Must not be null. At least one debit and one credit
entry must be specified. Any number of journal entries may be posted with a given date and branch id
as long as the standard accounting rules apply. For each entry its glCode, entryType and amount must
not be null.branchId
- a branch id.date
- The date of the posting of the journal entry. Must be not nullnotes
- transaction notesMambuApiException
public java.util.List<com.mambu.accounting.shared.model.GLJournalEntry> postGLJournalEntries(java.util.List<ApiGLJournalEntry> entries, java.lang.String branchId, java.lang.String date, java.lang.String notes, java.lang.String transactionId) throws MambuApiException
entries
- a list of entries with the GL transaction details. Must not be null. At least one debit and one credit
entry must be specified. Any number of journal entries may be posted with a given date and branch id
as long as the standard accounting rules apply. For each entry its glCode, entryType and amount must
not be null.branchId
- a branch id.date
- The date of the posting of the journal entry. Must be not nullnotes
- transaction notestransactionId
- the transaction idMambuApiException