If you have more than one company, each company can have its own invoice numbers. By default, all companies share one invoice number sequence.
Turn it on
- Go to Settings > Invoices.
- Turn on Separate invoice number for each company. You will see this option only when you have more than one company.
- Set the Initial number of the invoice for each company. It must be larger than the last invoice number of that company.
- Click Save.
How it works
- Each new invoice gets the next number of its own company.
- Credit notes, recurring invoices, subscription invoices and store order invoices follow the same rule.
- Existing invoices are not changed.
- Invoices that were created before you added companies belong to the default company.
- The invoice prefix and number format are the same for all companies.
- If Reset invoice number every year is on, each company starts again from 1 every year.
Turn it off
When you turn it off, all companies use one sequence again. The next invoice gets the highest number used so far plus one, so no number is used twice.
Example
| Company | Last invoice | Next invoice |
| Company A | INVOICE #152 | INVOICE #153 |
| Company B (initial number 500) | none | INVOICE #500 |
For developers
The helper prepare_invoice_display_id_data() now takes the company id as a third, optional parameter. Pass it when you create an invoice from a plugin. Without it, the default company is used.
prepare_invoice_display_id_data($due_date, $bill_date, $company_id);