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.