use of edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet in project cu-kfs by CU-CommunityApps.
the class AdvanceDepositServiceImpl method validate.
public boolean validate(Object parsedFileContents) {
boolean valid = true;
List<AchIncomeFile> achIncomeFiles = (ArrayList<AchIncomeFile>) parsedFileContents;
for (AchIncomeFile achIncomeFile : achIncomeFiles) {
initializeTransactionCountsAndAmounts();
String payerMessage = "";
if (validateTrailerRecord(achIncomeFile)) {
valid &= validateGroupCount(achIncomeFile);
valid &= validateLogicFileControlNumbers(achIncomeFile);
} else {
valid = false;
}
for (AchIncomeFileGroup achIncomeFileGroup : achIncomeFile.getGroups()) {
if (validateGroupTrailer(achIncomeFileGroup)) {
valid &= validateTransactionCount(achIncomeFileGroup);
valid &= validateGroupControlNumber(achIncomeFileGroup);
} else {
valid = false;
}
validateFunctionalIdentifierCode(achIncomeFile, achIncomeFileGroup);
for (AchIncomeFileTransactionSet achIncomeFileTransactionSet : achIncomeFileGroup.getTransactionSets()) {
if (validateTransactionTrailer(achIncomeFileTransactionSet)) {
valid &= validateTransactionSetControlNumbers(achIncomeFileTransactionSet);
} else {
valid = false;
}
// loop through the AchTransaction to get the total transaction count and amount
// for ACH and wired posted and skipped transactions
setAchIncomeTransactionCountsAndAmounts(achIncomeFileTransactionSet.getTransactionGuts());
payerMessage += validatePayerName(achIncomeFileTransactionSet.getTransactionGuts());
}
}
valid &= validateTimestamp(achIncomeFile);
achIncomeFile.setEmailMessageText(getEmailMessageText(achIncomeFile, payerMessage));
}
if (LOG.isInfoEnabled()) {
LOG.info("validate method executing");
}
return valid;
}
use of edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet in project cu-kfs by CU-CommunityApps.
the class AdvanceDepositServiceImpl method setAchTransactions.
protected void setAchTransactions(AchIncomeFile achIncomeFile, List achIncomeTransactions) {
Timestamp bankTimestamp = getFormattedTimestamp(achIncomeFile, "fileDate/time");
for (AchIncomeFileGroup achIncomeFileGroup : achIncomeFile.getGroups()) {
for (AchIncomeFileTransactionSet achIncomeFileTransactionSet : achIncomeFileGroup.getTransactionSets()) {
for (AchIncomeFileTransaction achIncomeFileTransaction : achIncomeFileTransactionSet.getTransactionGuts()) {
if (KFSConstants.GL_CREDIT_CODE.equals(achIncomeFileTransaction.getCreditDebitIndicator())) {
AchIncomeTransaction achIncomeTransaction = new AchIncomeTransaction();
achIncomeTransaction.setPaymentMethodCode(achIncomeFileTransaction.getPaymentMethodCode());
achIncomeTransaction.setEffectiveDate(achIncomeFileTransaction.getEffectiveDate());
achIncomeTransaction.setLoadTimestamp(dateTimeService.getCurrentTimestamp());
achIncomeTransaction.setBankTimestamp(bankTimestamp);
achIncomeTransaction.setTransactionAmount(achIncomeFileTransaction.getTransactionAmount());
achIncomeTransaction.setPayerName(truncatePayerNameIfNecessary(achIncomeFileTransaction));
achIncomeTransaction.setNotes(createNotes(achIncomeFileTransaction));
achIncomeTransactions.add(achIncomeTransaction);
}
}
}
}
}
use of edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionSet.
@Test
public void testParseLineIntoObjectAchIncomeFileTransactionSet() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 2, "transactionSetControlNumber");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTransactionSet achIncomeFileTransactionSet = new AchIncomeFileTransactionSet();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, ST_LINE, achIncomeFileTransactionSet, 1);
assertEquals("0001", achIncomeFileTransactionSet.getTransactionSetControlNumber());
}
use of edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet in project cu-kfs by CU-CommunityApps.
the class AdvanceDepositServiceImplTest method setupAchIncomeFilesMissingPayee.
protected List<AchIncomeFile> setupAchIncomeFilesMissingPayee() throws ParseException {
List<AchIncomeFile> achIncomeFiles = new ArrayList<>();
AchIncomeFile achIncomeFile = new AchIncomeFile();
achIncomeFile.setFileDate("160223");
achIncomeFile.setFileTime("2143");
achIncomeFile.setProductionOrTestIndicator("P");
achIncomeFile.setInterchangeControlNumber("000000000");
List<AchIncomeFileGroup> groups = new ArrayList<>();
AchIncomeFileGroup achIncomeFileGroup = new AchIncomeFileGroup();
achIncomeFileGroup.setGroupControlNumber("0");
achIncomeFileGroup.setGroupFunctionIdentifierCode("RA");
List<AchIncomeFileTransactionSet> achIncomeFileTransactionSets = new ArrayList<>();
AchIncomeFileTransactionSet achIncomeFileTransactionSet = new AchIncomeFileTransactionSet();
achIncomeFileTransactionSet.setTransactionSetControlNumber("0001");
AchIncomeFileTransactionSetTrailer achIncomeFileTransactionSetTrailer = new AchIncomeFileTransactionSetTrailer();
achIncomeFileTransactionSetTrailer.setTransactionSetControlNumber("0001");
achIncomeFileTransactionSet.setTransactionSetTrailer(achIncomeFileTransactionSetTrailer);
List<AchIncomeFileTransaction> transactionGuts = new ArrayList<>();
AchIncomeFileTransaction achIncomeFileTransaction = new AchIncomeFileTransaction();
achIncomeFileTransaction.setTransactionAmount(new KualiDecimal("12761.79"));
achIncomeFileTransaction.setCreditDebitIndicator("C");
achIncomeFileTransaction.setCompanyId("1111541330");
achIncomeFileTransaction.setPaymentMethodCode("ACH");
Date expectedDate = new Date(new SimpleDateFormat("yyyyMMdd").parse("20160223").getTime());
achIncomeFileTransaction.setEffectiveDate(expectedDate);
List<AchIncomeFileTransactionOpenItemReference> openItemReferences = new ArrayList<>();
openItemReferences.add(setupOpenItemReference("OI", "71201-16"));
achIncomeFileTransaction.setOpenItemReferences(openItemReferences);
transactionGuts.add(achIncomeFileTransaction);
achIncomeFileTransactionSet.setTransactionGuts(transactionGuts);
achIncomeFileTransactionSets.add(achIncomeFileTransactionSet);
achIncomeFileGroup.setTransactionSets(achIncomeFileTransactionSets);
AchIncomeFileGroupTrailer achIncomeFileGroupTrailer = new AchIncomeFileGroupTrailer();
achIncomeFileGroupTrailer.setGroupControlNumber("0");
achIncomeFileGroupTrailer.setTotalTransactionSets(1);
achIncomeFileGroup.setGroupTrailer(achIncomeFileGroupTrailer);
groups.add(achIncomeFileGroup);
achIncomeFile.setGroups(groups);
AchIncomeFileTrailer achIncomeFileTrailer = new AchIncomeFileTrailer();
achIncomeFileTrailer.setInterchangeControlNumber("000000000");
achIncomeFileTrailer.setTotalGroups(1);
achIncomeFile.setTrailer(achIncomeFileTrailer);
achIncomeFiles.add(achIncomeFile);
return achIncomeFiles;
}
Aggregations