use of edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionReference in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionReference.
@Test
public void testParseLineIntoObjectAchIncomeFileTransactionReference() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 1, "type");
setFlatFileProperty(parseProperties, 2, "value");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTransactionReference achIncomeFileTransactionReference = new AchIncomeFileTransactionReference();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, REF_LINE, achIncomeFileTransactionReference, 1);
assertEquals("GC", achIncomeFileTransactionReference.getType());
assertEquals("W911NF1420001", achIncomeFileTransactionReference.getValue());
}
use of edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionReference 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;
}
Aggregations