use of org.kuali.kfs.module.cam.businessobject.AssetGlpeSourceDetail in project cu-kfs by CU-CommunityApps.
the class AssetGlobalServiceImpl method createAssetGlpePostable.
/**
* Creates an instance of AssetGlpeSourceDetail depending on the source flag
*
* @param document University Date Service
* @param assetPaymentDetail Payment record for which postable is created
* @param amountCategory
* @return GL Postable source detail
*/
protected AssetGlpeSourceDetail createAssetGlpePostable(AssetGlobal document, AssetPaymentDetail assetPaymentDetail, AmountCategory amountCategory) {
if (LOG.isDebugEnabled()) {
LOG.debug("Start - createAssetGlpePostable (" + document.getDocumentNumber() + "-" + assetPaymentDetail.getAccountNumber() + ")");
}
AssetGlpeSourceDetail postable = new AssetGlpeSourceDetail();
assetPaymentDetail.refreshReferenceObject(CamsPropertyConstants.AssetPaymentDetail.ACCOUNT);
postable.setAccount(assetPaymentDetail.getAccount());
postable.setAmount(assetPaymentDetail.getAmount());
postable.setAccountNumber(assetPaymentDetail.getAccountNumber());
postable.setBalanceTypeCode(CamsConstants.Postable.GL_BALANCE_TYPE_CODE_AC);
postable.setChartOfAccountsCode(assetPaymentDetail.getChartOfAccountsCode());
postable.setDocumentNumber(document.getDocumentNumber());
postable.setFinancialSubObjectCode(assetPaymentDetail.getFinancialSubObjectCode());
postable.setPostingYear(assetPaymentDetail.getPostingYear());
postable.setPostingPeriodCode(assetPaymentDetail.getPostingPeriodCode());
postable.setProjectCode(assetPaymentDetail.getProjectCode());
postable.setSubAccountNumber(assetPaymentDetail.getSubAccountNumber());
postable.setOrganizationReferenceId(assetPaymentDetail.getOrganizationReferenceId());
assetPaymentDetail.refreshReferenceObject(CamsPropertyConstants.AssetPaymentDetail.OBJECT_CODE);
ObjectCode objectCode = objectCodeService.getByPrimaryIdForCurrentYear(assetPaymentDetail.getChartOfAccountsCode(), assetPaymentDetail.getFinancialObjectCode());
AssetObjectCode assetObjectCode = assetObjectCodeService.findAssetObjectCode(assetPaymentDetail.getChartOfAccountsCode(), objectCode.getFinancialObjectSubTypeCode());
OffsetDefinition offsetDefinition = offsetDefinitionService.getByPrimaryId(universityDateService.getCurrentFiscalYear(), assetPaymentDetail.getChartOfAccountsCode(), CamsConstants.AssetTransfer.DOCUMENT_TYPE_CODE, CamsConstants.Postable.GL_BALANCE_TYPE_CODE_AC);
document.refreshReferenceObject(CamsPropertyConstants.AssetGlobal.ACQUISITION_TYPE);
amountCategory.setParams(postable, assetPaymentDetail, assetObjectCode, offsetDefinition, document.getAcquisitionType());
if (LOG.isDebugEnabled()) {
LOG.debug("End - createAssetGlpePostable(" + document.getDocumentNumber() + "-" + assetPaymentDetail.getAccountNumber() + "-" + ")");
}
return postable;
}
Aggregations