It is allowed to delete not OKed sales order which is connected to the Purchase order. After deleting the sales order we have orphan purchase order. I'll report a bug.
I would like to know what BackgroundHALShouldPause does, and how to use it. While it's listed in the HAL Primitives report, it is not used in source code and it doesn't appear in the LMS HAL...