User wants to sort the expenses on manual invoices in alphabetical order of the Expense IDs. At present the sort order appears to be random.
By default, the Manual Invoice template lists the expenses in the alphabetical order of the expense entry descriptions while the Manual Invoice Custom Ordering template lists the expenses in the same order in which they were created on the invoice. If you want to customize the sort order for expenses on manual invoices and sort them in alphabetical order of the Expense IDs, you can do that in Global Settings > Invoice Templates. Under Show, select Manual Invoice and then click on Detail for the template you want to customize. Under Layout > Expense tab, select Item under Group By and save the changes. Core prompts you to save it as a new template. You can then apply this template to your invoices so that the expenses are listed by Expense ID. Check Core Help Center for details on customizing invoice templates and changing the invoice templates.