Search in sources :

Example 1 with AchIncomeFile

use of edu.cornell.kfs.fp.businessobject.AchIncomeFile 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;
}
Also used : AchIncomeFileGroup(edu.cornell.kfs.fp.businessobject.AchIncomeFileGroup) AchIncomeFileTransactionSet(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet) ArrayList(java.util.ArrayList) AchIncomeFile(edu.cornell.kfs.fp.businessobject.AchIncomeFile)

Example 2 with AchIncomeFile

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

the class AdvanceDepositServiceImpl method loadAchIncomeTransactions.

private void loadAchIncomeTransactions(Object parsedObject) {
    List<AchIncomeTransaction> achIncomeTransactions = new ArrayList();
    List<AchIncomeFile> achIncomeFiles = (List<AchIncomeFile>) parsedObject;
    for (AchIncomeFile achIncomeFile : achIncomeFiles) {
        setAchTransactions(achIncomeFile, achIncomeTransactions);
    }
    saveTransaction(achIncomeTransactions);
}
Also used : AchIncomeTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeTransaction) ArrayList(java.util.ArrayList) AchIncomeFile(edu.cornell.kfs.fp.businessobject.AchIncomeFile) List(java.util.List) ArrayList(java.util.ArrayList)

Example 3 with AchIncomeFile

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

the class AdvanceDepositServiceImpl method copyAllMessage.

private void copyAllMessage(Object parsedObject, PhysicalFlatFileInformation physicalFlatFileInformation) {
    List<AchIncomeFile> achIncomeFiles = (List<AchIncomeFile>) parsedObject;
    for (AchIncomeFile achIncomeFile : achIncomeFiles) {
        FlatFileInformation fileInformation = new FlatFileInformation();
        FlatFileTransactionInformation information = achIncomeFile.getFlatFileTransactionInformation();
        fileInformation.getOrAddFlatFileData(achIncomeFile.getInterchangeControlNumber(), information);
        fileInformation.addFileInfoMessage(achIncomeFile.getEmailMessageText());
        physicalFlatFileInformation.getFlatFileInfomationList().add(fileInformation);
    }
}
Also used : AchIncomeFile(edu.cornell.kfs.fp.businessobject.AchIncomeFile) List(java.util.List) ArrayList(java.util.ArrayList) PhysicalFlatFileInformation(org.kuali.kfs.sys.batch.PhysicalFlatFileInformation) FlatFileInformation(org.kuali.kfs.sys.batch.FlatFileInformation) FlatFileTransactionInformation(org.kuali.kfs.sys.batch.FlatFileTransactionInformation)

Example 4 with AchIncomeFile

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

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFile.

@Test
public void testParseLineIntoObjectAchIncomeFile() throws Exception {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 9, "fileDate");
    setFlatFileProperty(parseProperties, 10, "fileTime");
    setFlatFileProperty(parseProperties, 13, "interchangeControlNumber");
    setFlatFileProperty(parseProperties, 15, "productionOrTestIndicator");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFile achIncomeFile = new AchIncomeFile();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, ISA_LINE, achIncomeFile, 1);
    assertEquals("160223", achIncomeFile.getFileDate());
    assertEquals("2143", achIncomeFile.getFileTime());
    assertEquals("000000000", achIncomeFile.getInterchangeControlNumber());
    assertEquals("P", achIncomeFile.getProductionOrTestIndicator());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) ArrayList(java.util.ArrayList) AchIncomeFile(edu.cornell.kfs.fp.businessobject.AchIncomeFile) FlatFilePropertySpecification(org.kuali.kfs.sys.batch.FlatFilePropertySpecification) DelimitedFlatFilePropertySpecification(org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Test(org.junit.Test)

Example 5 with AchIncomeFile

use of edu.cornell.kfs.fp.businessobject.AchIncomeFile 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;
}
Also used : AchIncomeFileTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction) AchIncomeFileTransactionSetTrailer(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSetTrailer) AchIncomeFileGroup(edu.cornell.kfs.fp.businessobject.AchIncomeFileGroup) ArrayList(java.util.ArrayList) AchIncomeFileGroupTrailer(edu.cornell.kfs.fp.businessobject.AchIncomeFileGroupTrailer) Date(java.sql.Date) AchIncomeFileTransactionOpenItemReference(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionOpenItemReference) AchIncomeFileTrailer(edu.cornell.kfs.fp.businessobject.AchIncomeFileTrailer) AchIncomeFileTransactionSet(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet) AchIncomeFile(edu.cornell.kfs.fp.businessobject.AchIncomeFile) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) SimpleDateFormat(java.text.SimpleDateFormat)

Aggregations

AchIncomeFile (edu.cornell.kfs.fp.businessobject.AchIncomeFile)6 ArrayList (java.util.ArrayList)5 AchIncomeFileGroup (edu.cornell.kfs.fp.businessobject.AchIncomeFileGroup)2 AchIncomeFileTransactionSet (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet)2 List (java.util.List)2 Test (org.junit.Test)2 AchIncomeFileGroupTrailer (edu.cornell.kfs.fp.businessobject.AchIncomeFileGroupTrailer)1 AchIncomeFileTrailer (edu.cornell.kfs.fp.businessobject.AchIncomeFileTrailer)1 AchIncomeFileTransaction (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction)1 AchIncomeFileTransactionOpenItemReference (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionOpenItemReference)1 AchIncomeFileTransactionSetTrailer (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSetTrailer)1 AchIncomeTransaction (edu.cornell.kfs.fp.businessobject.AchIncomeTransaction)1 Date (java.sql.Date)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Pattern (java.util.regex.Pattern)1 AbstractFlatFileObjectSpecification (org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification)1 DelimitedFlatFilePropertySpecification (org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification)1 FlatFileInformation (org.kuali.kfs.sys.batch.FlatFileInformation)1 FlatFilePrefixObjectSpecification (org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification)1 FlatFilePropertySpecification (org.kuali.kfs.sys.batch.FlatFilePropertySpecification)1