Search in sources :

Example 6 with AchIncomeFileTransaction

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

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransaction.

@Test
public void testParseLineIntoObjectAchIncomeFileTransaction() throws Exception {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 2, "transactionAmount", KualiDecimalFormatter.class);
    setFlatFileProperty(parseProperties, 3, "creditDebitIndicator");
    setFlatFileProperty(parseProperties, 4, "paymentMethodCode");
    setFlatFileProperty(parseProperties, 16, "effectiveDate");
    setFlatFileProperty(parseProperties, 10, "companyId");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileTransaction achIncomeFileTransaction = new AchIncomeFileTransaction();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, BPR_LINE1, achIncomeFileTransaction, 1);
    assertEquals(new KualiDecimal("12761.79"), achIncomeFileTransaction.getTransactionAmount());
    assertEquals("C", achIncomeFileTransaction.getCreditDebitIndicator());
    assertEquals("ACH", achIncomeFileTransaction.getPaymentMethodCode());
    assertEquals(null, achIncomeFileTransaction.getEffectiveDate());
    assertEquals("1111541330", achIncomeFileTransaction.getCompanyId());
}
Also used : AchIncomeFileTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction) FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) ArrayList(java.util.ArrayList) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) 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 7 with AchIncomeFileTransaction

use of edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction 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

AchIncomeFileTransaction (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction)7 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)3 AchIncomeFileGroup (edu.cornell.kfs.fp.businessobject.AchIncomeFileGroup)2 AchIncomeFileTransactionSet (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet)2 SimpleDateFormat (java.text.SimpleDateFormat)2 AbstractFlatFileObjectSpecification (org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification)2 DelimitedFlatFilePropertySpecification (org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification)2 FlatFilePrefixObjectSpecification (org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification)2 FlatFilePropertySpecification (org.kuali.kfs.sys.batch.FlatFilePropertySpecification)2 AchIncomeFile (edu.cornell.kfs.fp.businessobject.AchIncomeFile)1 AchIncomeFileGroupTrailer (edu.cornell.kfs.fp.businessobject.AchIncomeFileGroupTrailer)1 AchIncomeFileTrailer (edu.cornell.kfs.fp.businessobject.AchIncomeFileTrailer)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 Timestamp (java.sql.Timestamp)1 Date (java.util.Date)1