This turned out to be database related & should be fixed in 2.0.7
Some background:
Invoice numbers are normally generated by the plugin using an AUTO_INCREMENT table in the database. This is the most reliable way to avoid duplicate invoice numbers, especially for stores with a high sales volume. Some servers have an alternative configuration for AUTO_INCREMENT that takes steps bigger than 1 (a MySQL setting called ‘auto_increment_increment’), which means that the invoice sequence then automatically takes the same steps, leaving gaps in the sequence.
I have a added a backup method that calculates each next invoice number by taking the last invoice number and adding +1. The downside of this method is that there is a higher risk of duplicate invoice numbers for shops with high peaks in sales volume (i.e. multiple orders per second), or when external applications trigger the generation of invoices simultaneously for multiple orders. Most shops will not have any issues with this method.
This option can be found under PDF Invoices > Status > Calculate document numbers (slow). As a failsafe mechanism, this setting is overriden to be automatically enabled in setups with an auto_increment_increment value higher than 1.
Ewout