Where does the invoice number come from?

The next available invoice number is defined in the sales configuration. Depending on your numbering policy, invoice numbers will be created either manually or automatically.