Many a times I have noticed that all lines of Order are Closed , but Order Header is still open.Workflow for Order Header is at workflow acrtivity "Close - Wait For Line" in notified status, and workflow for all lines are Closed/Purged state and line open flag = N.
Well, adata -fix required to resolve this issue. But you can do little further investigation from your side by executing below Query
select number_value from wf_item_attribute_values
and item_key = '&Order_header_id'
and name = '#WAITFORDETAIL'
if above query return value for "NUMBER_VALUE" , then that values indicates the No. of lines that are still Open from the Order Header Prospect.
Some Background - Header Workflow attribute #WAITFORDETAIL stores the # lines added in the Sales Order.Every time a line close this attribute decrease by 1 and finally when this attribute = 0 , Order header will close ( if all conditions to close header satisified). But ONCE a while a line close but this attribute at Order Header doesn't changes and finally when all lines close , this attribute still has a values > 0, and thus Order header remains open.
On setting this attribute to 0 Order headers will close (OFF COURSE all other condition (if any) to close header should satisify too).