Search in sources :

Example 1 with AchIncomeFileTransactionDateTime

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

the class AdvanceDepositServiceImpl method addPaymentInformationToNotes.

private StringBuilder addPaymentInformationToNotes(AchIncomeFileTransaction achIncomeFileTransaction) {
    StringBuilder notes = new StringBuilder();
    if (CuFPConstants.AchIncomeFileTransaction.TRANS_PAYMENT_METHOD_ACH.equals(achIncomeFileTransaction.getPaymentMethodCode())) {
        notes.append("ACH PAYMENT INFORMATION: ");
    }
    if (CuFPConstants.AchIncomeFileTransaction.TRANS_PAYMENT_METHOD_FWT.equals(achIncomeFileTransaction.getPaymentMethodCode())) {
        notes.append("WIRE PAYMENT INFORMATION: ");
    }
    notes.append("\n");
    notes.append("CREDIT: ");
    notes.append("$");
    notes.append(getFormattedAmount("##,##,###.00", achIncomeFileTransaction.getTransactionAmount()));
    notes.append(" ");
    notes.append(achIncomeFileTransaction.getCreditDebitIndicator());
    notes.append("\n");
    notes.append("EFFECTIVE DATE: ");
    notes.append(achIncomeFileTransaction.getEffectiveDate());
    notes.append("\n");
    notes.append("COMPANY ID: ");
    notes.append(achIncomeFileTransaction.getCompanyId());
    notes.append("\n");
    if (achIncomeFileTransaction.getTrace() != null) {
        notes.append("TRACE NUMBER: ");
        notes.append(achIncomeFileTransaction.getTrace().getTraceNumber());
        notes.append("\n");
    }
    List<AchIncomeFileTransactionReference> fileTransactionReferences = achIncomeFileTransaction.getReferences();
    for (AchIncomeFileTransactionReference fileTransactionReference : fileTransactionReferences) {
        if (CuFPConstants.AchIncomeFileTransactionReference.REF_REFERENCE_TYPE_TN.equals(fileTransactionReference.getType())) {
            notes.append("TRANSACTION NUMBER: ");
            notes.append(fileTransactionReference.getValue());
            notes.append("\n");
        }
        if (CuFPConstants.AchIncomeFileTransactionReference.REF_REFERENCE_TYPE_CT.equals(fileTransactionReference.getType())) {
            notes.append("CONTRACT NUMBER: ");
            notes.append(fileTransactionReference.getValue());
            notes.append("\n");
        }
        if (CuFPConstants.AchIncomeFileTransactionReference.REF_REFERENCE_TYPE_VV.equals(fileTransactionReference.getType())) {
            notes.append("VOUCHER NUMBER: ");
            notes.append(fileTransactionReference.getValue());
            notes.append("\n");
        }
    }
    List<AchIncomeFileTransactionDateTime> transactionDateTimes = achIncomeFileTransaction.getDateTimes();
    for (AchIncomeFileTransactionDateTime transactionDateTime : transactionDateTimes) {
        if (CuFPConstants.AchIncomeFileTransactionDateTime.DTM_DATE_TYPE_097.equals(transactionDateTime.getType())) {
            notes.append("TRANSACTION CREATION: ");
            notes.append(transactionDateTime.getDateTime());
            notes.append("\n");
        }
    }
    String payerNoteText = "";
    String receiverNoteText = "";
    List<AchIncomeFileTransactionPayerOrPayeeName> payerOrPayeeNames = achIncomeFileTransaction.getPayerOrPayees();
    for (AchIncomeFileTransactionPayerOrPayeeName payerOrPayeeName : payerOrPayeeNames) {
        if (CuFPConstants.AchIncomeFileTransactionPayerOrPayeeName.PAYER_TYPE_PE.equals(payerOrPayeeName.getType())) {
            receiverNoteText = payerOrPayeeName.getName();
            if (payerOrPayeeName.getIdCode() != null && payerOrPayeeName.getIdQualifier() != null) {
                receiverNoteText = receiverNoteText + " " + payerOrPayeeName.getIdCode() + ":" + payerOrPayeeName.getIdQualifier();
            }
        }
        if (CuFPConstants.AchIncomeFileTransactionPayerOrPayeeName.PAYER_TYPE_PR.equals(payerOrPayeeName.getType())) {
            payerNoteText = payerOrPayeeName.getName();
        }
    }
    if (StringUtils.isBlank(payerNoteText) && achIncomeFileTransaction.getPremiumAdminsContact() != null) {
        payerNoteText = achIncomeFileTransaction.getPremiumAdminsContact().getName();
    }
    if (StringUtils.isBlank(receiverNoteText) && achIncomeFileTransaction.getPremiumReceiverName() != null) {
        receiverNoteText = achIncomeFileTransaction.getPremiumReceiverName().getName();
    }
    if (StringUtils.isNotBlank(receiverNoteText)) {
        notes.append("RECEIVER: ");
        notes.append(receiverNoteText);
        notes.append("\n");
    }
    if (StringUtils.isNotBlank(payerNoteText)) {
        notes.append("ORIGINATOR: ");
        notes.append(payerNoteText);
        notes.append("\n");
    }
    return notes;
}
Also used : AchIncomeFileTransactionReference(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionReference) AchIncomeFileTransactionDateTime(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionDateTime) AchIncomeFileTransactionPayerOrPayeeName(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPayerOrPayeeName)

Example 2 with AchIncomeFileTransactionDateTime

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

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionDateTime.

@Test
public void testParseLineIntoObjectAchIncomeFileTransactionDateTime() throws Exception {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 1, "type");
    setFlatFileProperty(parseProperties, 2, "dateTime");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileTransactionDateTime achIncomeFileTransactionDateTime = new AchIncomeFileTransactionDateTime();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, DTM_LINE, achIncomeFileTransactionDateTime, 1);
    assertEquals("097", achIncomeFileTransactionDateTime.getType());
    assertEquals("20160222", achIncomeFileTransactionDateTime.getDateTime());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) ArrayList(java.util.ArrayList) FlatFilePropertySpecification(org.kuali.kfs.sys.batch.FlatFilePropertySpecification) DelimitedFlatFilePropertySpecification(org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification) AchIncomeFileTransactionDateTime(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionDateTime) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Test(org.junit.Test)

Aggregations

AchIncomeFileTransactionDateTime (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionDateTime)2 AchIncomeFileTransactionPayerOrPayeeName (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPayerOrPayeeName)1 AchIncomeFileTransactionReference (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionReference)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 AbstractFlatFileObjectSpecification (org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification)1 DelimitedFlatFilePropertySpecification (org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification)1 FlatFilePrefixObjectSpecification (org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification)1 FlatFilePropertySpecification (org.kuali.kfs.sys.batch.FlatFilePropertySpecification)1