public class LedgerAccountServiceImpl extends java.lang.Object implements LedgerAccountService
Modifier and Type | Field and Description |
---|---|
private SageoneConfig |
config |
private SagePagingService |
sagePagingService |
Constructor and Description |
---|
LedgerAccountServiceImpl(SagePagingService sagePagingService,
SageoneConfig config) |
Modifier and Type | Method and Description |
---|---|
LedgerAccount |
getFirstLedgerAccount(java.util.List<LedgerAccount> ledgerAccounts)
Gets the first ledger account from the ledgerAccountResponse.
|
LedgerAccount |
getLedgerAccountByNominalCode(java.util.List<LedgerAccount> ledgerAccounts,
int nominalCode)
Gets the id for the ledger account with provided nominal code from the ledgerAccountResponse.
|
LedgerAccount |
getLedgerAccountByNominalCode(java.lang.String shopId,
int nominalCode)
Gets the id for the ledger account with provided nominal code from the ledgerAccountResponse.
|
java.util.List<LedgerAccount> |
getLedgerAccounts(java.lang.String shopId)
Gets all ledger accounts from sage for this shop
Does a Webservice call to get the ledger accounts from sage
|
boolean |
isValidLedgerAccount(java.util.List<LedgerAccount> ledgerAccounts,
int nominalCode)
checks if this nominal code represents a valid ledger account
|
private SagePagingService sagePagingService
private SageoneConfig config
@Inject public LedgerAccountServiceImpl(SagePagingService sagePagingService, SageoneConfig config)
public java.util.List<LedgerAccount> getLedgerAccounts(java.lang.String shopId) throws WebserviceException
LedgerAccountService
getLedgerAccounts
in interface LedgerAccountService
WebserviceException
- if the webservice request or deserialization failed.public LedgerAccount getLedgerAccountByNominalCode(java.util.List<LedgerAccount> ledgerAccounts, int nominalCode) throws LedgerAccountNotFoundException
LedgerAccountService
getLedgerAccountByNominalCode
in interface LedgerAccountService
ledgerAccounts
- the ledger accounts from sagenominalCode
- the nominal code of the desired ledgerAccountLedgerAccountNotFoundException
- if there is no ledger account with this nominal codepublic LedgerAccount getLedgerAccountByNominalCode(java.lang.String shopId, int nominalCode) throws LedgerAccountNotFoundException
LedgerAccountService
getLedgerAccountByNominalCode
in interface LedgerAccountService
nominalCode
- the nominal code of the desired ledgerAccountLedgerAccountNotFoundException
- if there is no ledger account with this nominal codepublic boolean isValidLedgerAccount(java.util.List<LedgerAccount> ledgerAccounts, int nominalCode)
LedgerAccountService
isValidLedgerAccount
in interface LedgerAccountService
ledgerAccounts
- the ledger accounts from sagenominalCode
- the nominal code of the desired ledgerAccountpublic LedgerAccount getFirstLedgerAccount(java.util.List<LedgerAccount> ledgerAccounts) throws LedgerAccountNotFoundException
LedgerAccountService
getFirstLedgerAccount
in interface LedgerAccountService
ledgerAccounts
- the ledger accounts from sageLedgerAccountNotFoundException
- if there is no ledger account