RE: issue with closing sales transactions
I think you are saying that you have a SOP document that is showing in work not history when you search for it or items on it. However when you try to actually go into the order to edit it, the order complains that it is already posted. You are also noting that the header record has missing key fields.
This happens when a client machine crashes or disconnects after creating an order and lines but before saving the full header record. It is now a corrupted order.
You may choose another header record and copy the information using SQL from a good header record in to the fields of the bad header record, this will allow you to access the order in order to delete the items, then void or delete the order.
I do not recommend processing that order any further as it has been damaged and will be unpredictable.
Alternatively you can delete the order using SQL but you will need to reconcile your inventory to correct the qtys for the deleted records.
Tim.