Search in sources :

Example 1 with IncomingWireAchMapping

use of edu.cornell.kfs.fp.businessobject.IncomingWireAchMapping in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImpl method createSourceAccountingLine.

protected void createSourceAccountingLine(AchIncomeTransaction transaction, AdvanceDepositDocument advanceDepositDocument) {
    String chart = parameterService.getParameterValueAsString(GenerateAdvanceDepositDocumentsStep.class, CuFPParameterConstants.AdvanceDepositDocument.CHART);
    String objectCode = parameterService.getParameterValueAsString(GenerateAdvanceDepositDocumentsStep.class, CuFPParameterConstants.AdvanceDepositDocument.OBJECT_CODE);
    String account = parameterService.getParameterValueAsString(GenerateAdvanceDepositDocumentsStep.class, CuFPParameterConstants.AdvanceDepositDocument.ACCOUNT);
    IncomingWireAchMapping matchingIncomingWireAchMapping = null;
    Collection<IncomingWireAchMapping> incomingWireAchMappings = businessObjectService.findAll(IncomingWireAchMapping.class);
    for (IncomingWireAchMapping mapping : incomingWireAchMappings) {
        List<AchIncomeNote> notes = transaction.getNotes();
        if (doNotesMatch(mapping, notes)) {
            matchingIncomingWireAchMapping = mapping;
            break;
        }
    }
    if (ObjectUtils.isNotNull(matchingIncomingWireAchMapping)) {
        chart = matchingIncomingWireAchMapping.getChartOfAccountsCode();
        objectCode = matchingIncomingWireAchMapping.getFinancialObjectCode();
        account = matchingIncomingWireAchMapping.getAccountNumber();
    }
    setupSourceAccountingLine(transaction, advanceDepositDocument, chart, objectCode, account);
}
Also used : AchIncomeNote(edu.cornell.kfs.fp.businessobject.AchIncomeNote) IncomingWireAchMapping(edu.cornell.kfs.fp.businessobject.IncomingWireAchMapping)

Example 2 with IncomingWireAchMapping

use of edu.cornell.kfs.fp.businessobject.IncomingWireAchMapping in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImplTest method setUp.

@Before
public void setUp() {
    advanceDepositService = new TestableAdvanceDepositServiceImpl();
    advanceDepositService.setBusinessObjectService(new MockBusinessObjectService());
    advanceDepositService.setDateTimeService(new DateTimeServiceImpl());
    advanceDepositService.setParameterService(new MockParameterServiceImpl());
    mapping = new IncomingWireAchMapping();
    mapping.setShortDescription("ARMY");
    ArrayList<String> methodNames = new ArrayList<>();
    for (Method method : AdvanceDepositDocument.class.getMethods()) {
        if (!Modifier.isFinal(method.getModifiers()) && !method.getName().startsWith("set") && !method.getName().startsWith("get")) {
            methodNames.add(method.getName());
        }
    }
    IMockBuilder<AdvanceDepositDocument> builder = EasyMock.createMockBuilder(AdvanceDepositDocument.class).addMockedMethods(methodNames.toArray(new String[0]));
    advanceDepositDocument = builder.createNiceMock();
    GlobalVariables.getMessageMap().clearErrorMessages();
}
Also used : DateTimeServiceImpl(org.kuali.rice.core.impl.datetime.DateTimeServiceImpl) MockParameterServiceImpl(edu.cornell.kfs.sys.service.mock.MockParameterServiceImpl) AdvanceDepositDocument(org.kuali.kfs.fp.document.AdvanceDepositDocument) ArrayList(java.util.ArrayList) Method(java.lang.reflect.Method) IncomingWireAchMapping(edu.cornell.kfs.fp.businessobject.IncomingWireAchMapping) Before(org.junit.Before)

Aggregations

IncomingWireAchMapping (edu.cornell.kfs.fp.businessobject.IncomingWireAchMapping)2 AchIncomeNote (edu.cornell.kfs.fp.businessobject.AchIncomeNote)1 MockParameterServiceImpl (edu.cornell.kfs.sys.service.mock.MockParameterServiceImpl)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 AdvanceDepositDocument (org.kuali.kfs.fp.document.AdvanceDepositDocument)1 DateTimeServiceImpl (org.kuali.rice.core.impl.datetime.DateTimeServiceImpl)1