Skip to content

Commit

Permalink
test/issues: write up scenario for Issue 1312
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Dec 1, 2023
1 parent 5957ca4 commit 0f0e1a5
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/issues/issue1215_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,48 @@ func TestIssue1215(t *testing.T) {
require.NoError(t, batch.Create())
require.NoError(t, batch.Validate())
}

func TestIssue1332(t *testing.T) {
bh := ach.NewBatchHeader()
bh.ServiceClassCode = ach.MixedDebitsAndCredits
bh.CompanyName = "WhlBodyFit"
bh.CompanyIdentification = "MOOVTESTER"
bh.StandardEntryClassCode = ach.CCD
bh.CompanyEntryDescription = "PMTCHECK"
bh.EffectiveEntryDate = "230411"
bh.SettlementDate = "102"
bh.ODFIIdentification = "05310055"

entry := ach.NewEntryDetail()
entry.TransactionCode = ach.CheckingReturnNOCDebit
entry.RDFIIdentification = "12345678"
entry.CheckDigit = "0"
entry.DFIAccountNumber = "2345532322345"
entry.Amount = 0
entry.IdentificationNumber = " "
entry.IndividualName = "Whole Body Fitness "
entry.AddendaRecordIndicator = 1
entry.TraceNumber = "053100552202922"
entry.Category = ach.CategoryReturn

addenda99 := ach.NewAddenda99()
addenda99.ReturnCode = "R03"
addenda99.OriginalTrace = "273976363256887"
addenda99.DateOfDeath = ""
addenda99.OriginalDFI = "12100035"
addenda99.AddendaInformation = ""
addenda99.TraceNumber = "053100552202922"
entry.Addenda99 = addenda99

batch := ach.NewBatchCCD(bh)
batch.AddEntry(entry)
batch.SetValidation(&ValidateOpts{
// Needs to be set because we lose all information the original entry was a prenote.
// Typically the CompanyEntryDescription is set to PRENOTE, which is carried through
// to the return.
AllowInvalidAmounts: true,
})

require.NoError(t, batch.Create())
require.NoError(t, batch.Validate())
}

0 comments on commit 0f0e1a5

Please sign in to comment.