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);
}
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();
}
Aggregations