afrunt / jach

Java library for reading and writing ACH/NACHA documents
Apache License 2.0
44 stars 37 forks source link

Too Little 9 in block count #7

Closed wcarswell closed 6 years ago

wcarswell commented 6 years ago

https://github.com/afrunt/jach/blob/3e9795cd020a56f707c0ed2a8a91d2de07fa1010/src/main/java/com/afrunt/jach/logic/ACHWriter.java#L85

Hi,

I found another issue where the change in 2.5.0 does not add the correct amount of 9 in block count. This happens as writeLine increments the global lines variable.

It can be fixed using this logic

int numberOfLines = lines; for (int i = 0; i < 10 - (numberOfLines % 10) - 1; i++) { writeLine(writer, emptyLine); }

afrunt commented 6 years ago

@wcarswell thanks, I merged your PR