Adding a SharePoint document without category to a purchase invoice was incorrectly allowed

When adding a document without a category to a purchase invoice with SharePoint integration, an error message was incorrectly not displayed and the invoice was still created. Additionally, the invoice was shown as a draft, even though it had already been saved.