Thanks for your post.
Please Note : Invoice and sales receipt have their separate number sequences.
Invoice number and Sales receipt number are always in sequence unless someone change the number manually in the Invoice or Sales receipt.
So, Just find the correct Invoice number or Sales receipt where you up to and then when you create your next invoice or Sales receipt – enter that number and from the next invoice or Sales receipt it will start from that number onwards. If it doesn't, then change the template of Invoice and create a new invoice, now go back and change over to your one and see if from now it remembers it. It could relate to corrupted template (for both Invoice and/ Receipt). You may also want to do a Verify and Rebuild data file after changing the template (File > Utilities>)
But again, keep in mind that Invoice and sales receipt are using their own number sequences.
Hope this helps.
Let me know the outcome.
In addition to Dharmesh's reply, you might find it useful to know that Next and Previous on these forms go forward and back in date order. So, if your transactions are entered historically or are future dated, then you might find that the numbers appear to lose their sequencing.
I hope this helps.