Document numbers with company abbreviation

Is there a way to append the document numbers with company abbreviation?

For example: Sales order numbers for company AB will be AB-SO-0001, AB-SO-0002; company AC will be AC-SO-0001, AC-SO-0001. the numbers will be sequential with the company… as opposed to something like AB-SO-0001, AC-SO-0002…

hope that makes sense.

You need to write a custom autoname function for that in your custom app.