Search in sources :

Example 1 with AchIncomeFileTransactionPayerOrPayeeName

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

the class AdvanceDepositServiceImplTest method setupPayerAndPayee.

private List<AchIncomeFileTransactionPayerOrPayeeName> setupPayerAndPayee(String payerName) {
    AchIncomeFileTransactionPayerOrPayeeName achIncomeFileTransactionPayeeName = new AchIncomeFileTransactionPayerOrPayeeName();
    achIncomeFileTransactionPayeeName.setType("PE");
    achIncomeFileTransactionPayeeName.setName("CORNELL UNIVERSITY, INC");
    achIncomeFileTransactionPayeeName.setIdCode("93");
    achIncomeFileTransactionPayeeName.setIdQualifier("4B578");
    AchIncomeFileTransactionPayerOrPayeeName achIncomeFileTransactionPayerName = new AchIncomeFileTransactionPayerOrPayeeName();
    achIncomeFileTransactionPayerName.setType("PR");
    achIncomeFileTransactionPayerName.setName(payerName);
    List<AchIncomeFileTransactionPayerOrPayeeName> payerOrPayees = new ArrayList<>();
    payerOrPayees.add(achIncomeFileTransactionPayeeName);
    payerOrPayees.add(achIncomeFileTransactionPayerName);
    return payerOrPayees;
}
Also used : ArrayList(java.util.ArrayList) AchIncomeFileTransactionPayerOrPayeeName(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPayerOrPayeeName)

Example 2 with AchIncomeFileTransactionPayerOrPayeeName

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

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

the class AchIncomeDelimitedFlatFileSpecificationTest method parseLineIntoObjectAchIncomeFileTransactionPayerOrPayeeName.

protected void parseLineIntoObjectAchIncomeFileTransactionPayerOrPayeeName(String lineToParse, String expectedType, String expectedValue, String expectedIdQualifier, String expectedIdCode) {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 1, "type");
    setFlatFileProperty(parseProperties, 2, "name");
    setFlatFileProperty(parseProperties, 3, "idQualifier");
    setFlatFileProperty(parseProperties, 4, "idCode");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileTransactionPayerOrPayeeName achIncomeFileTransactionPayerOrPayeeName = new AchIncomeFileTransactionPayerOrPayeeName();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, lineToParse, achIncomeFileTransactionPayerOrPayeeName, 1);
    assertEquals(expectedType, achIncomeFileTransactionPayerOrPayeeName.getType());
    assertEquals(expectedValue, achIncomeFileTransactionPayerOrPayeeName.getName());
    assertEquals(expectedIdQualifier, achIncomeFileTransactionPayerOrPayeeName.getIdQualifier());
    assertEquals(expectedIdCode, achIncomeFileTransactionPayerOrPayeeName.getIdCode());
}
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) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) AchIncomeFileTransactionPayerOrPayeeName(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPayerOrPayeeName)

Aggregations

AchIncomeFileTransactionPayerOrPayeeName (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPayerOrPayeeName)3 ArrayList (java.util.ArrayList)2 AchIncomeFileTransactionDateTime (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionDateTime)1 AchIncomeFileTransactionReference (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionReference)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