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(GUID shopGuid,
int nominalCode)
Gets the id for the ledger account with provided nominal code 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.
|
java.util.List<LedgerAccount> |
getLedgerAccounts(GUID shopGuid)
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(GUID shopGuid) throws WebserviceException
LedgerAccountService
getLedgerAccounts
in interface LedgerAccountService
shopGuid
- GUID of the shop.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 sage.nominalCode
- The nominal code of the desired ledger account.LedgerAccountNotFoundException
- if there is no ledger account with this nominal codepublic LedgerAccount getLedgerAccountByNominalCode(GUID shopGuid, int nominalCode) throws LedgerAccountNotFoundException
LedgerAccountService
getLedgerAccountByNominalCode
in interface LedgerAccountService
shopGuid
- GUID of the shop.nominalCode
- The nominal code of the desired ledger account.LedgerAccountNotFoundException
- 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 sage.nominalCode
- The nominal code of the desired ledger account.public LedgerAccount getFirstLedgerAccount(java.util.List<LedgerAccount> ledgerAccounts) throws LedgerAccountNotFoundException
LedgerAccountService
getFirstLedgerAccount
in interface LedgerAccountService
ledgerAccounts
- The ledger accounts from sage.LedgerAccountNotFoundException
- if there is no ledger account