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;
}
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;
}
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());
}
Aggregations