This keeps happening, because the same number serie is used for both batches, and they are being filled/processed simultaniously.
The easy solution for this would be to press the "Renumber Document Numbers" button from the Actions. This should be done before sending to approval, but I think it can also be done after approval.
To understand the logic why this is happening, try to create 1 line in each batch and post, and then create again 2 or 3 lines... You will see that the numbers get used twice.