-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Batch number reassigned when batches are in descending order in nacha file #1431
Comments
Side note: If we deem this to be a valid issue, i'd love to work on this as my first good task :) |
Interesting.. My recollection of the Nacha spec says batch numbers must be in ascending order, so this likely isn't handled. Go ahead and open a PR for this! How were you planning on fixing this? |
Yeah, batches can be unordered as well it looks like. I'm thinking that just removing |
I'm not sure if that will work. We rely on tabulation of BatchNumbers in a few code paths, but I'm curious to see what you come up with. |
Yeah Im digging more into this today. But the general direction im looking at is that, do not reassign a batch number unless its set to anything less than 1 instead of the current behavior which is resetting the value for anything <= 1. |
ACH Version
v1.33.3
What were you trying to do?
We are trying to process a file that looks something like this:
When the file is getting parsed, we noticed that the batch numbers were incorrectly reassigned because of the
<=
logic here. In the loop, when we get to 3rd batch (batchSeq
=3
) which is batch1
, the<=
condition allows the if block to execute where we are resetting the batch number to 3. So we end up with 2 different batches set to the same batch number.AllowUnorderedBatches
validation option set to allow for random ordering of batches.What did you expect to see?
Batch number should not be reset to 1 when the batches are in descending order
What did you see?
batch number 1 is reassigned to 3
How can we reproduce the problem?
Create a small file with descending batches and atleast one entry in each batch and run it through the parser.
The text was updated successfully, but these errors were encountered: