Search in sources :

Example 1 with GlLineService

use of org.kuali.kfs.module.cam.document.service.GlLineService 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);
}
Also used : CapitalAssetInformation(org.kuali.kfs.fp.businessobject.CapitalAssetInformation) GeneralLedgerEntry(org.kuali.kfs.module.cam.businessobject.GeneralLedgerEntry) GlLineService(org.kuali.kfs.module.cam.document.service.GlLineService)

Aggregations

CapitalAssetInformation (org.kuali.kfs.fp.businessobject.CapitalAssetInformation)1 GeneralLedgerEntry (org.kuali.kfs.module.cam.businessobject.GeneralLedgerEntry)1 GlLineService (org.kuali.kfs.module.cam.document.service.GlLineService)1