use of org.kuali.kfs.module.cam.businessobject.GeneralLedgerEntry 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.module.cam.businessobject.GeneralLedgerEntry in project cu-kfs by CU-CommunityApps.
the class CapitalAssetInformationAction method process.
/**
* Action "process" from CAB GL Lookup screen is processed by this method
*
* @param mapping {@link ActionMapping}
* @param form {@link ActionForm}
* @param request {@link HttpServletRequest}
* @param response {@link HttpServletResponse}
* @return {@link ActionForward}
* @throws Exception
*/
public ActionForward process(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
CapitalAssetInformationForm capitalAssetForm = (CapitalAssetInformationForm) form;
String glAcctId = request.getParameter(CamsPropertyConstants.GeneralLedgerEntry.GENERAL_LEDGER_ACCOUNT_IDENTIFIER);
Long cabGlEntryId = Long.valueOf(glAcctId);
capitalAssetForm.setGeneralLedgerAccountIdentifier(cabGlEntryId);
GeneralLedgerEntry entry = findGeneralLedgerEntry(request);
if (ObjectUtils.isNotNull(entry)) {
prepareRecordsForDisplay(capitalAssetForm, entry);
}
// }
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.module.cam.businessobject.GeneralLedgerEntry in project cu-kfs by CU-CommunityApps.
the class CapitalAssetInformationAction method prepareRecordsForDisplay.
protected void prepareRecordsForDisplay(CapitalAssetInformationForm capitalAssetForm, GeneralLedgerEntry entry) {
GlLineService glLineService = SpringContext.getBean(GlLineService.class);
entry.setSelected(true);
capitalAssetForm.setGeneralLedgerEntry(entry);
capitalAssetForm.setPrimaryGlAccountId(entry.getGeneralLedgerAccountIdentifier());
List<CapitalAssetInformation> capitalAssetInformations = glLineService.findAllCapitalAssetInformation(entry.getDocumentNumber());
Collection<GeneralLedgerEntry> glEntries = glLineService.findAllGeneralLedgerEntry(entry.getDocumentNumber());
if (!capitalAssetInformations.isEmpty() && capitalAssetInformations.size() != glEntries.size()) {
// we need to generate missing capital asset info
glLineService.setupMissingCapitalAssetInformation(entry.getDocumentNumber());
}
List<CapitalAssetInformation> capitalAssetInformation = glLineService.findCapitalAssetInformationForGLLine(entry);
// to render and subsequent processing to occur successfully.
if (capitalAssetInformation.isEmpty()) {
glLineService.setupCapitalAssetInformation(entry);
capitalAssetInformation = glLineService.findCapitalAssetInformationForGLLine(entry);
}
capitalAssetForm.setCapitalAssetInformation(capitalAssetInformation);
}
use of org.kuali.kfs.module.cam.businessobject.GeneralLedgerEntry in project cu-kfs by CU-CommunityApps.
the class CapitalAssetInformationAction method findGeneralLedgerEntry.
/**
* Retrieves the CAB General Ledger Entry from DB
*
* @param generalLedgerEntryId Entry Id
* @return GeneralLedgerEntry
*/
protected GeneralLedgerEntry findGeneralLedgerEntry(Long generalLedgerEntryId, boolean requireNew) {
BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
Map<String, Object> pkeys = new HashMap<String, Object>();
pkeys.put(CamsPropertyConstants.GeneralLedgerEntry.GENERAL_LEDGER_ACCOUNT_IDENTIFIER, generalLedgerEntryId);
if (requireNew) {
pkeys.put(CamsPropertyConstants.GeneralLedgerEntry.ACTIVITY_STATUS_CODE, CamsConstants.ActivityStatusCode.NEW);
}
GeneralLedgerEntry entry = boService.findByPrimaryKey(GeneralLedgerEntry.class, pkeys);
return entry;
}
Aggregations