You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project I work on reads ACH files and then converts them to CSV. When an Addenda 99 Dishonor is parsed, the value is truncated. This is happening because the parser is grabbing the 3 blank spaces that proceed the Return Trace Number. The ReturnTraceNumberField method takes the first 15 characters of the ReturnTraceNumber value, which drops off the last 3 characters.
The problem appears to be with the Parse method
func (Addenda99Dishonored*Addenda99Dishonored) Parse(recordstring) {
runeCount:=utf8.RuneCountInString(record)
ifruneCount!=94 {
return
}
buf:=getBuffer()
defersaveBuffer(buf)
reset:=func() string {
out:=buf.String()
buf.Reset()
returnout
}
// We're going to process the record rune-by-rune and at each field cutoff save the value.varidxintfor_, r:=rangerecord {
idx++// Append rune to bufferbuf.WriteRune(r)
// At each cutoff save the buffer and resetswitchidx {
case0, 1:
// 1-1 Always 7reset()
case3:
Addenda99Dishonored.TypeCode=reset()
case6:
Addenda99Dishonored.DishonoredReturnReasonCode=reset()
case21:
Addenda99Dishonored.OriginalEntryTraceNumber=reset()
case35:
Addenda99Dishonored.OriginalReceivingDFIIdentification=reset()
case53:
Addenda99Dishonored.ReturnTraceNumber=reset()
case56:
Addenda99Dishonored.ReturnSettlementDate=reset()
case58:
Addenda99Dishonored.ReturnReasonCode=reset()
case79:
Addenda99Dishonored.AddendaInformation=reset()
case94:
Addenda99Dishonored.TraceNumber=reset()
}
}
}
The blank spaces between the Original Receiving DFI Identification and Return Trace Number are unaccounted. Adding the following fixes the issue
case 38:
// 36-38 reserved - Leave blankreset()
What did you expect to see?
The ReturnTraceNumberField method would return all 15 digits of the Trace Number
What did you see?
A string with 3 leading blank spaces and missing the last 3 digits was returned.
How can we reproduce the problem?
Read an ACH file that has an Addenda 99 Dishonor. Then call the ReturnTraceNumberField method on the field. The value will be wrong. Using ReturnTraceNumber works, so there is a workaround.
The text was updated successfully, but these errors were encountered:
ACH Version
v1.45.3
What were you trying to do?
The project I work on reads ACH files and then converts them to CSV. When an Addenda 99 Dishonor is parsed, the value is truncated. This is happening because the parser is grabbing the 3 blank spaces that proceed the Return Trace Number. The ReturnTraceNumberField method takes the first 15 characters of the ReturnTraceNumber value, which drops off the last 3 characters.
The problem appears to be with the Parse method
The blank spaces between the Original Receiving DFI Identification and Return Trace Number are unaccounted. Adding the following fixes the issue
What did you expect to see?
The ReturnTraceNumberField method would return all 15 digits of the Trace Number
What did you see?
A string with 3 leading blank spaces and missing the last 3 digits was returned.
How can we reproduce the problem?
Read an ACH file that has an Addenda 99 Dishonor. Then call the ReturnTraceNumberField method on the field. The value will be wrong. Using ReturnTraceNumber works, so there is a workaround.
The text was updated successfully, but these errors were encountered: