Search in sources :

Example 1 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractCashAdvanceServiceImpl method findAccountingInfoForCashAdvanceLine.

@Override
public ConcurAccountInfo findAccountingInfoForCashAdvanceLine(ConcurStandardAccountingExtractDetailLine cashAdvanceLine, List<ConcurStandardAccountingExtractDetailLine> saeLines) {
    LOG.debug("findAccountingInfoForCashAdvanceLine, entering");
    ConcurAccountInfo info = new ConcurAccountInfo();
    String cashAdvanceReportEntryId = cashAdvanceLine.getReportEntryId();
    if (LOG.isDebugEnabled()) {
        LOG.debug("findAccountingInfoForCashAdvanceLine, cashAdvanceReportEntryId: " + cashAdvanceReportEntryId);
    }
    for (ConcurStandardAccountingExtractDetailLine line : saeLines) {
        if (StringUtils.equalsIgnoreCase(line.getReportEntryId(), cashAdvanceReportEntryId) && !isCashAdvanceLine(line)) {
            info.setChart(line.getChartOfAccountsCode());
            info.setAccountNumber(line.getAccountNumber());
            info.setSubAccountNumber(line.getSubAccountNumber());
            info.setObjectCode(line.getJournalAccountCode());
            info.setSubObjectCode(line.getSubObjectCode());
            info.setProjectCode(line.getProjectCode());
            info.setOrgRefId(line.getOrgRefId());
            if (LOG.isDebugEnabled()) {
                LOG.debug("findAccountingInfoForCashAdvanceLine, returning Concur account info: " + info.toString());
            }
            break;
        }
    }
    return info;
}
Also used : ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo) ConcurStandardAccountingExtractDetailLine(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)

Example 2 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractServiceImpl method getAccountingEntryForLine.

private PdpFeedAccountingEntry getAccountingEntryForLine(PdpFeedDetailEntry detailEntry, ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) {
    ConcurAccountInfo concurAccountInfo = buildConcurAccountInfoFromExtractDetailLine(line, concurStandardAccountingExtractFile);
    for (PdpFeedAccountingEntry accountingEntry : detailEntry.getAccounting()) {
        if (isCurrentAccountingEntrySameAsLineDetail(accountingEntry, concurAccountInfo)) {
            return accountingEntry;
        }
    }
    PdpFeedAccountingEntry accountingEntry = getConcurStandardAccountExtractPdpEntryService().buildPdpFeedAccountingEntry(concurAccountInfo);
    detailEntry.getAccounting().add(accountingEntry);
    return accountingEntry;
}
Also used : ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo) PdpFeedAccountingEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)

Example 3 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo in project cu-kfs by CU-CommunityApps.

the class ConcurReportsServiceImpl method extractAccountingInfoFromReportHeader.

protected ConcurAccountInfo extractAccountingInfoFromReportHeader(ExpenseReportDetailsDTO reportDetails) {
    String chart = ConcurUtils.extractCodeFromCodeAndDescriptionValue(reportDetails.getOrgUnit1());
    String accountNumber = ConcurUtils.extractCodeFromCodeAndDescriptionValue(reportDetails.getOrgUnit2());
    String subAccountNumber = ConcurUtils.extractCodeFromCodeAndDescriptionValue(reportDetails.getOrgUnit3());
    String subObjectCode = ConcurUtils.extractCodeFromCodeAndDescriptionValue(reportDetails.getOrgUnit4());
    String projectCode = ConcurUtils.extractCodeFromCodeAndDescriptionValue(reportDetails.getOrgUnit5());
    ConcurAccountInfo concurAccountInfo = new ConcurAccountInfo(chart, accountNumber, subAccountNumber, null, subObjectCode, projectCode);
    concurAccountInfo.setForPersonalCorporateCardExpense(true);
    return concurAccountInfo;
}
Also used : ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)

Example 4 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo in project cu-kfs by CU-CommunityApps.

the class ConcurReportsServiceImpl method extractConcurReportFromTravelRequestDetails.

protected ConcurReport extractConcurReportFromTravelRequestDetails(String reportURI) {
    TravelRequestDetailsDTO travelRequestDetailsDTO = retrieveTravelRequestDetails(reportURI);
    List<ConcurAccountInfo> concurAccountInfos = extractAccountInfoFromTravelRequestDetails(travelRequestDetailsDTO);
    return new ConcurReport(travelRequestDetailsDTO.getRequestID(), travelRequestDetailsDTO.getConcurStatucCode(), travelRequestDetailsDTO.getWorkflowActionURL(), concurAccountInfos);
}
Also used : ConcurReport(edu.cornell.kfs.concur.businessobjects.ConcurReport) TravelRequestDetailsDTO(edu.cornell.kfs.concur.rest.xmlObjects.TravelRequestDetailsDTO) ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)

Example 5 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractCashAdvanceServiceImplTest method validateFindAccountingInfoForCashAdvanceLine.

@Test
public void validateFindAccountingInfoForCashAdvanceLine() {
    List<ConcurStandardAccountingExtractDetailLine> saeLines = buildSAELines();
    ConcurStandardAccountingExtractDetailLine line = ConcurSAEDetailLineFixture.PDP_TEST_CASH_ADVANCE_500.toDetailLine();
    ConcurAccountInfo info = concurStandardAccountingExtractCashAdvanceService.findAccountingInfoForCashAdvanceLine(line, saeLines);
    assertEquals("Charts should match", ParameterTestValues.COLLECTOR_CHART_CODE, info.getChart());
    assertEquals("Accounts should match", ConcurTestConstants.ACCT_1234321, info.getAccountNumber());
}
Also used : ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo) ConcurStandardAccountingExtractDetailLine(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine) Test(org.junit.Test)

Aggregations

ConcurAccountInfo (edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)13 ValidationResult (edu.cornell.kfs.concur.businessobjects.ValidationResult)3 ConcurStandardAccountingExtractDetailLine (edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)2 ConcurReport (edu.cornell.kfs.concur.businessobjects.ConcurReport)2 ConcurBatchReportLineValidationErrorItem (edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)1 PdpFeedAccountingEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)1 ExpenseReportDetailsDTO (edu.cornell.kfs.concur.rest.xmlObjects.ExpenseReportDetailsDTO)1 TravelRequestDetailsDTO (edu.cornell.kfs.concur.rest.xmlObjects.TravelRequestDetailsDTO)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1