use of org.kuali.kfs.fp.businessobject.CapitalAssetAccountsGroupDetails in project cu-kfs by CU-CommunityApps.
the class GlLineServiceImpl method deactivateGLEntries.
protected void deactivateGLEntries(GeneralLedgerEntry entry, Document document, Integer capitalAssetLineNumber) {
// now deactivate the gl line..
CapitalAssetInformation capitalAssetInformation = findCapitalAssetInformation(entry.getDocumentNumber(), capitalAssetLineNumber);
if (ObjectUtils.isNotNull(capitalAssetInformation)) {
List<CapitalAssetAccountsGroupDetails> groupAccountingLines = capitalAssetInformation.getCapitalAssetAccountsGroupDetails();
Collection<GeneralLedgerEntry> documentGlEntries = findAllGeneralLedgerEntry(entry.getDocumentNumber());
for (CapitalAssetAccountsGroupDetails accountingLine : groupAccountingLines) {
// find the matching GL entry for this accounting line.
Collection<GeneralLedgerEntry> glEntries = findMatchingGeneralLedgerEntries(documentGlEntries, accountingLine);
for (GeneralLedgerEntry glEntry : glEntries) {
KualiDecimal lineAmount = accountingLine.getAmount();
// update submitted amount on the gl entry and save the results.
createGeneralLedgerEntryAsset(glEntry, document, capitalAssetLineNumber);
updateTransactionSumbitGlEntryAmount(glEntry, lineAmount);
}
}
}
}
use of org.kuali.kfs.fp.businessobject.CapitalAssetAccountsGroupDetails in project cu-kfs by CU-CommunityApps.
the class GlLineServiceImpl method addToCapitalAssetsMatchingLineType.
/**
* Compares the gl line to the group accounting lines in each capital asset and
* when finds a match, adds the capital asset to the list of matching assets. It also checks the accounting line type against the GL line credit/debit code.
*
* @param matchingAssets
* @param capitalAsset
* @param entry
* @param capitalAssetLineType
*/
protected void addToCapitalAssetsMatchingLineType(List<CapitalAssetInformation> matchingAssets, CapitalAssetInformation capitalAsset, GeneralLedgerEntry entry) {
List<CapitalAssetAccountsGroupDetails> groupAccountLines = capitalAsset.getCapitalAssetAccountsGroupDetails();
for (CapitalAssetAccountsGroupDetails groupAccountLine : groupAccountLines) {
if (groupAccountLine.getDocumentNumber().equals(entry.getDocumentNumber()) && groupAccountLine.getChartOfAccountsCode().equals(entry.getChartOfAccountsCode()) && groupAccountLine.getAccountNumber().equals(entry.getAccountNumber()) && groupAccountLine.getFinancialObjectCode().equals(entry.getFinancialObjectCode())) {
// check that debit matches target acct lines and credit matches
// source accounting lines
boolean isGroupLineSource = StringUtils.equals(groupAccountLine.getFinancialDocumentLineTypeCode(), KFSConstants.SOURCE_ACCT_LINE_TYPE_CODE);
boolean isGroupLineTarget = StringUtils.equals(groupAccountLine.getFinancialDocumentLineTypeCode(), KFSConstants.TARGET_ACCT_LINE_TYPE_CODE);
boolean isGLEntryCredit = StringUtils.equals(entry.getTransactionDebitCreditCode(), KFSConstants.GL_CREDIT_CODE);
boolean isGLEntryDebit = StringUtils.equals(entry.getTransactionDebitCreditCode(), KFSConstants.GL_DEBIT_CODE);
boolean isErrorCorrection = groupAccountLine.getAmount().isNegative();
logAddToCapitalAssetsMatchingLineTypeDetails(isGroupLineSource, isGroupLineTarget, isGLEntryCredit, isGLEntryDebit, isErrorCorrection, groupAccountLine, entry);
if ((isGroupLineSource && isGLEntryCredit) || (isGroupLineTarget && isGLEntryDebit) || (isErrorCorrection && isGroupLineSource && isGLEntryDebit) || (isErrorCorrection && isGroupLineTarget && isGLEntryCredit)) {
matchingAssets.add(capitalAsset);
break;
}
}
}
}
use of org.kuali.kfs.fp.businessobject.CapitalAssetAccountsGroupDetails in project cu-kfs by CU-CommunityApps.
the class GlLineServiceImpl method getNextAccountingLineNumber.
/**
* calculates the next accounting line number for accounts details for each capital asset.
* Goes through the current records and gets the last accounting line number.
*
* @param capitalAsset
* @return nextAccountingLineNumber
*/
protected Integer getNextAccountingLineNumber(CapitalAccountingLines capitalAccountingLine, CapitalAssetInformation capitalAsset) {
Integer nextAccountingLineNumber = 0;
List<CapitalAssetAccountsGroupDetails> capitalAssetAccountLines = capitalAsset.getCapitalAssetAccountsGroupDetails();
for (CapitalAssetAccountsGroupDetails capitalAssetAccountLine : capitalAssetAccountLines) {
nextAccountingLineNumber = capitalAssetAccountLine.getCapitalAssetAccountLineNumber();
}
return ++nextAccountingLineNumber;
}
Aggregations