use of org.kuali.kfs.module.cam.businessobject.AssetPaymentDetail in project cu-kfs by CU-CommunityApps.
the class GlLineServiceImpl method createAssetPaymentDetails.
/**
* Creates asset payment details based on accounting lines distributed
* for the given capital asset.
*
* @param entry
* @param document
* @param seqNo
* @param capitalAssetLineNumber
* @return List<AssetPaymentDetail>
*/
protected List<AssetPaymentDetail> createAssetPaymentDetails(GeneralLedgerEntry entry, Document document, int seqNo, Integer capitalAssetLineNumber) {
List<AssetPaymentDetail> appliedPayments = new ArrayList<AssetPaymentDetail>();
CapitalAssetInformation capitalAssetInformation = findCapitalAssetInformation(entry.getDocumentNumber(), capitalAssetLineNumber);
Collection<GeneralLedgerEntry> documentGlEntries = findAllGeneralLedgerEntry(entry.getDocumentNumber());
if (ObjectUtils.isNotNull(capitalAssetInformation)) {
List<CapitalAssetAccountsGroupDetails> groupAccountingLines = capitalAssetInformation.getCapitalAssetAccountsGroupDetails();
Integer paymentSequenceNumber = 1;
for (CapitalAssetAccountsGroupDetails accountingLine : groupAccountingLines) {
AssetPaymentDetail detail = new AssetPaymentDetail();
// find matching gl entry for asset accounting line
for (GeneralLedgerEntry glEntry : documentGlEntries) {
if (doesGeneralLedgerEntryMatchAssetAccountingDetails(glEntry, accountingLine)) {
entry = glEntry;
}
}
// TODO
// sub-object code, as well as sub-account, project code, and org ref id, shall not be populated from GL entry;
// instead, they need to be passed from the original FP document for each individual accounting line to be stored in CapitalAssetAccountsGroupDetails,
// and copied into each corresponding accounting line in Asset Payment here.
detail.setDocumentNumber(document.getDocumentNumber());
detail.setSequenceNumber(paymentSequenceNumber++);
detail.setPostingYear(entry.getUniversityFiscalYear());
detail.setPostingPeriodCode(entry.getUniversityFiscalPeriodCode());
detail.setChartOfAccountsCode(accountingLine.getChartOfAccountsCode());
detail.setAccountNumber(replaceFiller(accountingLine.getAccountNumber()));
detail.setSubAccountNumber(replaceFiller(accountingLine.getSubAccountNumber()));
detail.setFinancialObjectCode(replaceFiller(accountingLine.getFinancialObjectCode()));
detail.setFinancialSubObjectCode(replaceFiller(accountingLine.getFinancialSubObjectCode()));
detail.setProjectCode(replaceFiller(accountingLine.getProjectCode()));
detail.setOrganizationReferenceId(replaceFiller(accountingLine.getOrganizationReferenceId()));
// detail.setAmount(KFSConstants.GL_CREDIT_CODE.equals(debitCreditCode) ? accountingLine.getAmount().negated() : accountingLine.getAmount());
detail.setAmount(getAccountingLineAmountForPaymentDetail(entry, accountingLine));
detail.setExpenditureFinancialSystemOriginationCode(replaceFiller(entry.getFinancialSystemOriginationCode()));
detail.setExpenditureFinancialDocumentNumber(entry.getDocumentNumber());
detail.setExpenditureFinancialDocumentTypeCode(replaceFiller(entry.getFinancialDocumentTypeCode()));
detail.setExpenditureFinancialDocumentPostedDate(entry.getTransactionDate());
detail.setPurchaseOrderNumber(replaceFiller(entry.getReferenceFinancialDocumentNumber()));
detail.setTransferPaymentIndicator(false);
detail.refreshNonUpdateableReferences();
appliedPayments.add(detail);
}
}
return appliedPayments;
}
use of org.kuali.kfs.module.cam.businessobject.AssetPaymentDetail in project cu-kfs by CU-CommunityApps.
the class GlLineServiceImpl method createAssetPaymentDetail.
/**
* NOTE: This method is not used anywhere in project.
* Creates asset payment detail based on GL line. to CAB
*
* @param entry GeneralLedgerEntry
* @param document Document
* @return AssetPaymentDetail
*/
protected AssetPaymentDetail createAssetPaymentDetail(GeneralLedgerEntry entry, Document document, int seqNo, Integer capitalAssetLineNumber) {
// This is not added to constructor in CAMS to provide module isolation from CAMS
AssetPaymentDetail detail = new AssetPaymentDetail();
detail.setDocumentNumber(document.getDocumentNumber());
detail.setSequenceNumber(seqNo);
detail.setPostingYear(entry.getUniversityFiscalYear());
detail.setPostingPeriodCode(entry.getUniversityFiscalPeriodCode());
detail.setChartOfAccountsCode(entry.getChartOfAccountsCode());
detail.setAccountNumber(replaceFiller(entry.getAccountNumber()));
detail.setSubAccountNumber(replaceFiller(entry.getSubAccountNumber()));
detail.setFinancialObjectCode(replaceFiller(entry.getFinancialObjectCode()));
detail.setFinancialSubObjectCode(replaceFiller(entry.getFinancialSubObjectCode()));
detail.setProjectCode(replaceFiller(entry.getProjectCode()));
detail.setOrganizationReferenceId(replaceFiller(entry.getOrganizationReferenceId()));
KualiDecimal capitalAssetAmount = getCapitalAssetAmount(entry, capitalAssetLineNumber);
detail.setAmount(capitalAssetAmount);
detail.setExpenditureFinancialSystemOriginationCode(replaceFiller(entry.getFinancialSystemOriginationCode()));
detail.setExpenditureFinancialDocumentNumber(entry.getDocumentNumber());
detail.setExpenditureFinancialDocumentTypeCode(replaceFiller(entry.getFinancialDocumentTypeCode()));
detail.setExpenditureFinancialDocumentPostedDate(entry.getTransactionDate());
detail.setPurchaseOrderNumber(replaceFiller(entry.getReferenceFinancialDocumentNumber()));
detail.setTransferPaymentIndicator(false);
return detail;
}
Aggregations